Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactors.

  • Loading branch information...
commit c3ea2480da7c5f76d73e245857b90180f6c2864a 1 parent 66e9daf
@lrsjng authored
View
1  README.md
@@ -60,6 +60,7 @@ It profits from these great projects:
* adds optional natural sort of items
* adds optional checkboxes to select items
* adds text preview modes: none, fixed, markdown
+* optionally hide folders in main view
* makes use of EXIF thumbnails optional
* fixes file deletion of multiple files
* fixes `setParentFolderLabels = false`
View
0  src/_h5ai/client/images/select.svg → src/_h5ai/client/images/selected.svg
File renamed without changes
View
17 src/_h5ai/client/js/inc/ext/select.js
@@ -6,6 +6,8 @@ modulejs.define('ext/select', ['_', '$', 'core/settings', 'core/resource', 'core
checkboxes: false
}, allsettings.select),
+ template = '<span class="selector"><img src="' + resource.image('selected') + '" alt="selected"/></span>',
+
x = 0, y = 0,
l = 0, t = 0, w = 0, h = 0,
shrink = 1/3,
@@ -115,14 +117,17 @@ modulejs.define('ext/select', ['_', '$', 'core/settings', 'core/resource', 'core
initItem = function (item) {
if (item.$view) {
- item.$view.find('.selector').on('click', function (event) {
- event.stopImmediatePropagation();
- event.preventDefault();
+ $(template)
+ .appendTo(item.$view.find('a'))
+ .on('click', function (event) {
+
+ event.stopImmediatePropagation();
+ event.preventDefault();
- item.$view.toggleClass('selected');
- publish();
- });
+ item.$view.toggleClass('selected');
+ publish();
+ });
}
},
View
4 src/_h5ai/client/js/inc/view/items.js
@@ -15,9 +15,6 @@ modulejs.define('view/items', ['_', '$', 'core/settings', 'core/resource', 'core
'<span class="label"/>' +
'<span class="date"/>' +
'<span class="size"/>' +
- '<span class="selector">' +
- '<img src="' + resource.image('select') + '" alt="selected"/>' +
- '</span>' +
'</a>' +
'</li>',
hintTemplate = '<span class="hint"/>',
@@ -75,7 +72,6 @@ modulejs.define('view/items', ['_', '$', 'core/settings', 'core/resource', 'core
$label.addClass('l10n-parentDirectory');
}
$html.addClass('folder-parent');
- $html.find('.selector').remove();
}
if (item.$view) {
Please sign in to comment.
Something went wrong with that request. Please try again.