Merge pull request #273 from owncloud/new-actions-regiter
Register actions via brand new API
This commit is contained in:
commit
5c36e82e0d
@ -21,12 +21,12 @@ var odfViewer = {
|
||||
}
|
||||
for (var i = 0; i < odfViewer.supportedMimesRead.length; ++i) {
|
||||
var mime = odfViewer.supportedMimesRead[i];
|
||||
FileActions.register(mime, 'View', OC.PERMISSION_READ, '', odfViewer.onView);
|
||||
FileActions.setDefault(mime, 'View');
|
||||
OCA.Files.fileActions.register(mime, 'View', OC.PERMISSION_READ, '', odfViewer.onView);
|
||||
OCA.Files.fileActions.setDefault(mime, 'View');
|
||||
}
|
||||
for (var i = 0; i < odfViewer.supportedMimesUpdate.length; ++i) {
|
||||
var mime = odfViewer.supportedMimesUpdate[i];
|
||||
FileActions.register(
|
||||
OCA.Files.fileActions.register(
|
||||
mime,
|
||||
t('documents', 'Edit'),
|
||||
OC.PERMISSION_UPDATE,
|
||||
@ -56,7 +56,7 @@ var odfViewer = {
|
||||
|
||||
onView: function(filename) {
|
||||
var webodfSource = (oc_debug === true) ? 'webodf-debug' : 'webodf',
|
||||
attachTo = odfViewer.isDocuments ? '#documents-content' : 'table',
|
||||
attachTo = odfViewer.isDocuments ? '#documents-content' : '#app-content-files',
|
||||
attachToolbarTo = odfViewer.isDocuments ? '#content-wrapper' : '#controls';
|
||||
|
||||
if (odfViewer.isDocuments){
|
||||
@ -83,6 +83,7 @@ var odfViewer = {
|
||||
$(attachToolbarTo).prepend(odfToolbarHtml);
|
||||
$('#odf-toolbar').css({position:'fixed'});
|
||||
} else {
|
||||
$('#controls').css({left:'0px'});
|
||||
$(attachToolbarTo).append(odfToolbarHtml);
|
||||
}
|
||||
|
||||
@ -101,6 +102,9 @@ var odfViewer = {
|
||||
FileList.setViewerMode(false);
|
||||
$('#odf-toolbar').remove();
|
||||
$('#odf-canvas').remove();
|
||||
if (!odfViewer.isDocuments){
|
||||
$('#controls').css({left:'auto'});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user