summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2013-03-04 13:49:52 -0800
committerLukas Reschke <lukas@statuscode.ch>2013-03-04 13:49:52 -0800
commit76e6369ec162f85f41a25212ca83bd95c44c9a9d (patch)
tree41596c494fbf5b5e37c9056473ccf335a2c06906
parentfdb37d191b930e891302de22b91138d5ca864132 (diff)
parente9f46a745224a8ac551a1303462769c052f6d7b5 (diff)
downloadnextcloud-server-76e6369ec162f85f41a25212ca83bd95c44c9a9d.tar.gz
nextcloud-server-76e6369ec162f85f41a25212ca83bd95c44c9a9d.zip
Merge pull request #2077 from owncloud/oc_filepicker_inline_js
Remove inline js from OC.Dialogs.FilePicker.
-rw-r--r--core/js/oc-dialogs.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index 28dec97fd30..cfbca2833c7 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -129,13 +129,13 @@ var OCdialogs = {
var p;
if ($(c_id).data('multiselect') == true) {
p = [];
- $(c_id+' .filepicker_element_selected #filename').each(function(i, elem) {
+ $(c_id+' .filepicker_element_selected .filename').each(function(i, elem) {
p.push(($(c_id).data('path')?$(c_id).data('path'):'')+'/'+$(elem).text());
});
} else {
var p = $(c_id).data('path');
if (p == undefined) p = '';
- p = p+'/'+$(c_id+' .filepicker_element_selected #filename').text()
+ p = p+'/'+$(c_id+' .filepicker_element_selected .filename').text()
}
callback(p);
$(c_id).dialog('close');
@@ -216,13 +216,15 @@ var OCdialogs = {
}
},
fillFilePicker:function(r, dialog_content_id) {
- var entry_template = '<div onclick="javascript:OC.dialogs.handlePickerClick(this, \'*ENTRYNAME*\',\''+dialog_content_id+'\')" data="*ENTRYTYPE*"><img src="*MIMETYPEICON*" style="margin-right:1em;"><span id="filename">*NAME*</span><div style="float:right;margin-right:1em;">*LASTMODDATE*</div></div>';
+ var entry_template = '<div data-entryname="*ENTRYNAME*" data-dcid="'+dialog_content_id+'" data="*ENTRYTYPE*"><img src="*MIMETYPEICON*" style="margin-right:1em;"><span class="filename">*NAME*</span><div style="float:right;margin-right:1em;">*LASTMODDATE*</div></div>';
var names = '';
$.each(r.data, function(index, a) {
names += entry_template.replace('*LASTMODDATE*', OC.mtime2date(a.mtime)).replace('*NAME*', a.name).replace('*MIMETYPEICON*', a.mimetype_icon).replace('*ENTRYNAME*', a.name).replace('*ENTRYTYPE*', a.type);
});
- $(dialog_content_id + ' #filelist').html(names);
+ $(dialog_content_id + ' #filelist').html(names).on('click', '[data="file"]', function() {
+ OC.dialogs.handlePickerClick(this, $(this).data('entryname'), $(this).data('dcid'));
+ });
$(dialog_content_id + ' .filepicker_loader').css('visibility', 'hidden');
},
handleTreeListSelect:function(event) {