From d256564c435c5cef02262fb64fb2bddcd38c05a1 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Tue, 21 Nov 2017 15:13:15 -0700 Subject: add full view toggle kb shortcut --- static/ui.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'static') diff --git a/static/ui.js b/static/ui.js index 4f9305c..4df0550 100644 --- a/static/ui.js +++ b/static/ui.js @@ -109,10 +109,17 @@ var AppModel = Backbone.Model.extend({ }, star: function() { - if(this.get('selectedIndex') > 0) { + if(this.get('selectedIndex') >= 0) { App.items.at(this.get('selectedIndex')).toggleStar(); } + }, + + full: function() { + if(this.get('selectedIndex') >= 0) { + App.items.at(this.get('selectedIndex')).full(); + } } + }); var App = new AppModel(); @@ -206,7 +213,7 @@ var Item = Backbone.Model.extend({ }, full: function() { - this.set({'full': true}); + this.set({'full': !(this.get('full'))} ); } }); @@ -544,7 +551,10 @@ function boot() { event.preventDefault(); App.star(); } - + if (event.which == 70) { + event.preventDefault(); + App.full(); + } }); App.boot(); -- cgit v1.2.3