Merge pull request #16829 from nextcloud/bugfix/noid/projects-pick-folders
Let users pick folders on projects
This commit is contained in:
commit
d2bd413440
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,2 +1,2 @@
|
|||
!function(e){var n={};function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(r,i,function(n){return e[n]}.bind(null,i));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/js/",t(t.s=0)}([function(e,n,r){r.p=OC.linkTo("files_sharing","js/dist/"),r.nc=btoa(OC.requestToken),window.OCP.Collaboration.registerType("file",{action:function(){return new Promise(function(e,n){OC.dialogs.filepicker(t("files_sharing","Link to a file"),function(t){OC.Files.getClient().getFileInfo(t).then(function(n,t){e(t.id)},function(){n()})},!1)})},typeString:t("files_sharing","Link to a file"),typeIconClass:"icon-files-dark"})}]);
|
||||
!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/js/",t(t.s=0)}([function(e,n,r){r.p=OC.linkTo("files_sharing","js/dist/"),r.nc=btoa(OC.requestToken),window.OCP.Collaboration.registerType("file",{action:function(){return new Promise(function(e,n){OC.dialogs.filepicker(t("files_sharing","Link to a file"),function(t){OC.Files.getClient().getFileInfo(t).then(function(n,t){e(t.id)}).fail(function(){n()})},!1,null,!1,OC.dialogs.FILEPICKER_TYPE_CHOOSE,"",{allowDirectoryChooser:!0})})},typeString:t("files_sharing","Link to a file"),typeIconClass:"icon-files-dark"})}]);
|
||||
//# sourceMappingURL=collaboration.js.map
|
File diff suppressed because one or more lines are too long
|
@ -8,10 +8,10 @@ window.OCP.Collaboration.registerType('file', {
|
|||
const client = OC.Files.getClient();
|
||||
client.getFileInfo(f).then((status, fileInfo) => {
|
||||
resolve(fileInfo.id);
|
||||
}, () => {
|
||||
}).fail(() => {
|
||||
reject();
|
||||
});
|
||||
}, false);
|
||||
}, false, null, false, OC.dialogs.FILEPICKER_TYPE_CHOOSE, '', { allowDirectoryChooser: true });
|
||||
});
|
||||
},
|
||||
typeString: t('files_sharing', 'Link to a file'),
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -195,8 +195,9 @@ const Dialogs = {
|
|||
* @param modal make the dialog modal
|
||||
* @param type Type of file picker : Choose, copy, move, copy and move
|
||||
* @param path path to the folder that the the file can be picket from
|
||||
* @param options additonal options that need to be set
|
||||
*/
|
||||
filepicker: function (title, callback, multiselect, mimetypeFilter, modal, type, path) {
|
||||
filepicker: function (title, callback, multiselect, mimetypeFilter, modal, type, path, options) {
|
||||
var self = this;
|
||||
|
||||
this.filepicker.sortField = 'name';
|
||||
|
@ -221,6 +222,9 @@ const Dialogs = {
|
|||
|
||||
this.filelist = null;
|
||||
path = path || '';
|
||||
options = Object.assign({
|
||||
allowDirectoryChooser: false
|
||||
}, options)
|
||||
|
||||
$.when(this._getFilePickerTemplate()).then(function ($tmpl) {
|
||||
self.filepicker.loading = false;
|
||||
|
@ -244,7 +248,7 @@ const Dialogs = {
|
|||
nameCol: t('core', 'Name'),
|
||||
sizeCol: t('core', 'Size'),
|
||||
modifiedCol: t('core', 'Modified')
|
||||
}).data('path', path).data('multiselect', multiselect).data('mimetype', mimetypeFilter);
|
||||
}).data('path', path).data('multiselect', multiselect).data('mimetype', mimetypeFilter).data('allowDirectoryChooser', options.allowDirectoryChooser)
|
||||
|
||||
if (modal === undefined) {
|
||||
modal = false;
|
||||
|
@ -457,7 +461,7 @@ const Dialogs = {
|
|||
// Hence this is one of the approach to get the choose button.
|
||||
var getOcDialog = self.$filePicker.closest('.oc-dialog');
|
||||
var buttonEnableDisable = getOcDialog.find('.primary');
|
||||
if (self.$filePicker.data('mimetype').indexOf("httpd/unix-directory") !== -1) {
|
||||
if (self.$filePicker.data('mimetype').indexOf("httpd/unix-directory") !== -1 && !self.$filePicker.data('.allowDirectoryChooser')) {
|
||||
buttonEnableDisable.prop("disabled", false);
|
||||
} else {
|
||||
buttonEnableDisable.prop("disabled", true);
|
||||
|
@ -1178,7 +1182,7 @@ const Dialogs = {
|
|||
} else if ($element.data('type') === 'dir') {
|
||||
this._fillFilePicker(this.$filePicker.data('path') + '/' + $element.data('entryname'));
|
||||
this._changeButtonsText(type, $element.data('entryname'));
|
||||
if (this.$filePicker.data('mimetype').indexOf("httpd/unix-directory") !== -1) {
|
||||
if (this.$filePicker.data('mimetype').indexOf("httpd/unix-directory") !== -1 || this.$filePicker.data('allowDirectoryChooser')) {
|
||||
buttonEnableDisable.prop("disabled", false);
|
||||
} else {
|
||||
buttonEnableDisable.prop("disabled", true);
|
||||
|
|
Loading…
Reference in New Issue