diff options
| author | 2013-11-25 19:30:02 -0500 | |
|---|---|---|
| committer | 2013-11-25 19:30:02 -0500 | |
| commit | 7e06d0df30af18219d8b35e07634c08494adef32 (patch) | |
| tree | 2bb3d834b97aee66c781a9c1847a8b25bd6e3cf3 /public/scripts | |
| parent | faf5225d4c6bfd537bab3ffe579a87655b7b4ada (diff) | |
Changement de syntaxe pour être conforme à la norme utilisée ailleurs.
Diffstat (limited to 'public/scripts')
| -rw-r--r-- | public/scripts/main.js | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/public/scripts/main.js b/public/scripts/main.js index bc40e4879..3077d611a 100644 --- a/public/scripts/main.js +++ b/public/scripts/main.js @@ -1,18 +1,7 @@ "use strict"; var $stream = null; -// Create a new object to store FreshRSS methods and variables. -// It will prevent over-riding other libraries methods and variables. -var FreshRSS = {}; -FreshRSS.isCollapsed = true; - -FreshRSS.Entry = {}; - -// Toggle the collapse flag -FreshRSS.Entry.toggleCollapse = function() { - FreshRSS.isCollapsed = !FreshRSS.isCollapsed; - $(".flux.current").toggleClass("active"); -}; +var isCollapsed = true; function is_normal_mode() { return $stream.hasClass('normal'); @@ -158,7 +147,7 @@ function toggleContent(new_active, old_active) { old_active.removeClass("active").removeClass("current"); if (old_active[0] !== new_active[0]) { - if (FreshRSS.isCollapsed) { + if (isCollapsed) { new_active.addClass("active"); }; new_active.addClass("current"); @@ -229,6 +218,11 @@ function next_entry() { } } +function collapse_entry() { + isCollapsed = !isCollapsed; + $(".flux.current").toggleClass("active"); +}; + function inMarkViewport(flux, box_to_follow, relative_follow) { var top = flux.position().top; if (relative_follow) { @@ -343,7 +337,7 @@ function init_shortcuts() { 'disable_in_input': true }); shortcut.add(shortcuts.collapse_entry, function () { - FreshRSS.Entry.toggleCollapse(); + collapse_entry(); }, { 'disable_in_input': true }); |
