mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-04-05 21:23:23 +02:00
Update sidebar toggle.
This commit is contained in:
parent
6be58e6506
commit
f857ae3841
3
src/_h5ai/client/images/ui/back.svg
Normal file
3
src/_h5ai/client/images/ui/back.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" version="1.1">
|
||||
<path d="M20 11h-12.17l5.59-5.59-1.42-1.41-8 8 8 8 1.41-1.41-5.58-5.59h12.17v-2z" fill="#555"/>
|
||||
</svg>
|
After Width: | Height: | Size: 241 B |
3
src/_h5ai/client/images/ui/info.svg
Normal file
3
src/_h5ai/client/images/ui/info.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="24" height="24" version="1.1">
|
||||
<path d="M 12 2 C 6.48 2 2 6.48 2 12 C 2 17.52 6.48 22 12 22 C 17.52 22 22 17.52 22 12 C 22 6.48 17.52 2 12 2 z M 11 7 L 13 7 L 13 9 L 11 9 L 11 7 z M 11 11 L 13 11 L 13 17 L 11 17 L 11 11 z" fill="#555"/>
|
||||
</svg>
|
After Width: | Height: | Size: 331 B |
@ -3,13 +3,14 @@ modulejs.define('view/sidebar', ['$', 'core/resource', 'core/store'], function (
|
||||
var storekey = 'sidebarIsVisible';
|
||||
var toggleTemplate =
|
||||
'<div id="sidebar-toggle" class="tool">' +
|
||||
'<img src="' + resource.image('settings') + '" alt="settings"/>' +
|
||||
'<img alt="settings"/>' +
|
||||
'</div>';
|
||||
|
||||
|
||||
function update(toggle) {
|
||||
|
||||
var $toggle = $('#sidebar-toggle');
|
||||
var $img = $toggle.find('img');
|
||||
var $sidebar = $('#sidebar');
|
||||
var isVisible = store.get(storekey);
|
||||
|
||||
@ -20,9 +21,11 @@ modulejs.define('view/sidebar', ['$', 'core/resource', 'core/store'], function (
|
||||
|
||||
if (isVisible) {
|
||||
$toggle.addClass('current');
|
||||
$img.attr('src', resource.image('back'));
|
||||
$sidebar.show();
|
||||
} else {
|
||||
$toggle.removeClass('current');
|
||||
$img.attr('src', resource.image('settings'));
|
||||
$sidebar.hide();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user