diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-11-02 15:31:09 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-11-05 14:29:53 +0100 |
commit | 8fd434886b5d5ec1e2471732d53c92724ab04fa4 (patch) | |
tree | fe2d6a3d2d9bc0950cf81334fe47d067a46dd8ca /tpl/default/js/shaarli.js | |
parent | 7a50e56a6373c572cf5589d7dd427ae2b07edb36 (diff) | |
download | Shaarli-8fd434886b5d5ec1e2471732d53c92724ab04fa4.tar.gz Shaarli-8fd434886b5d5ec1e2471732d53c92724ab04fa4.tar.zst Shaarli-8fd434886b5d5ec1e2471732d53c92724ab04fa4.zip |
Minor adjustments
Diffstat (limited to 'tpl/default/js/shaarli.js')
-rw-r--r-- | tpl/default/js/shaarli.js | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tpl/default/js/shaarli.js b/tpl/default/js/shaarli.js index 53ec20c5..3afec7f3 100644 --- a/tpl/default/js/shaarli.js +++ b/tpl/default/js/shaarli.js | |||
@@ -68,16 +68,18 @@ var searchInputs = document.querySelectorAll('#search input[type="text"]'); | |||
68 | }); | 68 | }); |
69 | 69 | ||
70 | /** | 70 | /** |
71 | * Fold/Expand shaares description. | 71 | * Fold/Expand shaares description and thumbnail. |
72 | */ | 72 | */ |
73 | var foldButtons = document.querySelectorAll('.fold-button'); | 73 | var foldButtons = document.querySelectorAll('.fold-button'); |
74 | [].forEach.call(foldButtons, function(foldButton) { | 74 | [].forEach.call(foldButtons, function(foldButton) { |
75 | // Retrieve description | 75 | // Retrieve description |
76 | var description = null; | 76 | var description = null; |
77 | var thumbnail = null; | ||
77 | var linklistItem = getParentByClass(foldButton, 'linklist-item'); | 78 | var linklistItem = getParentByClass(foldButton, 'linklist-item'); |
78 | if (linklistItem != null) { | 79 | if (linklistItem != null) { |
79 | description = linklistItem.querySelector('.linklist-item-description'); | 80 | description = linklistItem.querySelector('.linklist-item-description'); |
80 | if (description != null) { | 81 | thumbnail = linklistItem.querySelector('.linklist-item-thumbnail'); |
82 | if (description != null || thumbnail != null) { | ||
81 | foldButton.style.display = 'inline'; | 83 | foldButton.style.display = 'inline'; |
82 | } | 84 | } |
83 | } | 85 | } |
@@ -88,11 +90,21 @@ var foldButtons = document.querySelectorAll('.fold-button'); | |||
88 | // Switch fold/expand - up = fold | 90 | // Switch fold/expand - up = fold |
89 | if (event.target.classList.contains('fa-chevron-up')) { | 91 | if (event.target.classList.contains('fa-chevron-up')) { |
90 | event.target.title = 'Expand'; | 92 | event.target.title = 'Expand'; |
91 | description.style.display = 'none'; | 93 | if (description != null) { |
94 | description.style.display = 'none'; | ||
95 | } | ||
96 | if (thumbnail != null) { | ||
97 | thumbnail.style.display = 'none'; | ||
98 | } | ||
92 | } | 99 | } |
93 | else { | 100 | else { |
94 | event.target.title = 'Fold'; | 101 | event.target.title = 'Fold'; |
95 | description.style.display = 'block'; | 102 | if (description != null) { |
103 | description.style.display = 'block'; | ||
104 | } | ||
105 | if (thumbnail != null) { | ||
106 | thumbnail.style.display = 'block'; | ||
107 | } | ||
96 | } | 108 | } |
97 | event.target.classList.toggle('fa-chevron-down'); | 109 | event.target.classList.toggle('fa-chevron-down'); |
98 | event.target.classList.toggle('fa-chevron-up'); | 110 | event.target.classList.toggle('fa-chevron-up'); |