mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 04:24:45 -04:00
Add alwaysVisible option to download button.
This commit is contained in:
parent
506c93340a
commit
3e617ae005
4 changed files with 24 additions and 11 deletions
|
@ -4,15 +4,17 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co
|
|||
var settings = _.extend({
|
||||
enabled: false,
|
||||
type: 'php-tar',
|
||||
packageName: 'package'
|
||||
packageName: 'package',
|
||||
alwaysVisible: false
|
||||
}, allsettings.download),
|
||||
|
||||
downloadBtnTemplate = '<li id="download">' +
|
||||
'<a href="#">' +
|
||||
'<img src="' + resource.image('download') + '" alt="download"/>' +
|
||||
'<span class="l10n-download"/>' +
|
||||
'</a>' +
|
||||
'</li>',
|
||||
downloadBtnTemplate =
|
||||
'<li id="download">' +
|
||||
'<a href="#">' +
|
||||
'<img src="' + resource.image('download') + '" alt="download"/>' +
|
||||
'<span class="l10n-download"/>' +
|
||||
'</a>' +
|
||||
'</li>',
|
||||
|
||||
selectedItems = [],
|
||||
|
||||
|
@ -22,8 +24,8 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co
|
|||
|
||||
selectedItems = items.slice(0);
|
||||
if (selectedItems.length) {
|
||||
$download.appendTo('#navbar').show();
|
||||
} else {
|
||||
$download.show();
|
||||
} else if (!settings.alwaysVisible) {
|
||||
$download.hide();
|
||||
}
|
||||
},
|
||||
|
@ -52,6 +54,10 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co
|
|||
.find('a').on('click', onClick).end()
|
||||
.appendTo('#navbar');
|
||||
|
||||
if (settings.alwaysVisible) {
|
||||
$('#download').show();
|
||||
}
|
||||
|
||||
event.sub('selection', onSelection);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue