diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2013-03-04 16:36:49 +0100 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2013-03-04 16:36:49 +0100 |
commit | e9f46a745224a8ac551a1303462769c052f6d7b5 (patch) | |
tree | 2d897a0beba7892bc4f09d020402e66ce347c9b4 /core/js/oc-dialogs.js | |
parent | ef70978524ad0f00c3e5f03a489753547afee45a (diff) | |
download | nextcloud-server-e9f46a745224a8ac551a1303462769c052f6d7b5.tar.gz nextcloud-server-e9f46a745224a8ac551a1303462769c052f6d7b5.zip |
Remove inline js from OC.Dialogs.FilePicker.
Diffstat (limited to 'core/js/oc-dialogs.js')
-rw-r--r-- | core/js/oc-dialogs.js | 10 |
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) { |