diff --git a/build/bundle.js b/build/bundle.js index 32bfe239..9b300ffd 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -13713,13 +13713,11 @@ var ConfirmCancelView = require('../views').ConfirmCancelView; var LeftRightView = require('../views').LeftRightView; var ModalAlert = require('../views').ModalAlert; -var NAV_EVENT_DELAY = 300; - var MultiView = Backbone.View.extend({ tagName: 'div', className: 'multiView', // ms to debounce the nav functions - navEventDelay: 1500, + navEventDebounce: 150, // a simple mapping of what childViews we support typeToConstructor: { @@ -13753,25 +13751,34 @@ var MultiView = Backbone.View.extend({ getPosFunc: function() { return _.debounce(_.bind(function() { this.navForward(); - }, this), NAV_EVENT_DELAY, true); + }, this), this.navEventDebounce, true); }, getNegFunc: function() { return _.debounce(_.bind(function() { this.navBackward(); - }, this), NAV_EVENT_DELAY, true); + }, this), this.navEventDebounce, true); }, navForward: function() { + if (this.currentIndex === this.childViews.length - 1) { + this.hideViewIndex(this.currentIndex); + this.finish(); + return; + } + this.navIndexChange(1); }, navBackward: function() { + if (this.currentIndex === 0) { + return; + } + this.navIndexChange(-1); }, navIndexChange: function(delta) { - console.log('doing nav index change', delta); this.hideViewIndex(this.currentIndex); this.currentIndex += delta; this.showViewIndex(this.currentIndex); @@ -13785,6 +13792,11 @@ var MultiView = Backbone.View.extend({ this.childViews[index].show(); }, + finish: function() { + // promise resolve?? + console.log('promise resolve :D'); + }, + createChildView: function(viewJSON) { var type = viewJSON.type; if (!this.typeToConstructor[type]) { @@ -17026,13 +17038,11 @@ var ConfirmCancelView = require('../views').ConfirmCancelView; var LeftRightView = require('../views').LeftRightView; var ModalAlert = require('../views').ModalAlert; -var NAV_EVENT_DELAY = 300; - var MultiView = Backbone.View.extend({ tagName: 'div', className: 'multiView', // ms to debounce the nav functions - navEventDelay: 1500, + navEventDebounce: 150, // a simple mapping of what childViews we support typeToConstructor: { @@ -17066,25 +17076,34 @@ var MultiView = Backbone.View.extend({ getPosFunc: function() { return _.debounce(_.bind(function() { this.navForward(); - }, this), NAV_EVENT_DELAY, true); + }, this), this.navEventDebounce, true); }, getNegFunc: function() { return _.debounce(_.bind(function() { this.navBackward(); - }, this), NAV_EVENT_DELAY, true); + }, this), this.navEventDebounce, true); }, navForward: function() { + if (this.currentIndex === this.childViews.length - 1) { + this.hideViewIndex(this.currentIndex); + this.finish(); + return; + } + this.navIndexChange(1); }, navBackward: function() { + if (this.currentIndex === 0) { + return; + } + this.navIndexChange(-1); }, navIndexChange: function(delta) { - console.log('doing nav index change', delta); this.hideViewIndex(this.currentIndex); this.currentIndex += delta; this.showViewIndex(this.currentIndex); @@ -17098,6 +17117,11 @@ var MultiView = Backbone.View.extend({ this.childViews[index].show(); }, + finish: function() { + // promise resolve?? + console.log('promise resolve :D'); + }, + createChildView: function(viewJSON) { var type = viewJSON.type; if (!this.typeToConstructor[type]) { diff --git a/src/index.html b/src/index.html index b996ca4e..af463649 100644 --- a/src/index.html +++ b/src/index.html @@ -163,7 +163,7 @@ <% if (showLeft) { %>
<% } else { %> -
+
<% } %>
diff --git a/src/js/views/multiView.js b/src/js/views/multiView.js index c0a70a27..26566d9f 100644 --- a/src/js/views/multiView.js +++ b/src/js/views/multiView.js @@ -10,13 +10,11 @@ var ConfirmCancelView = require('../views').ConfirmCancelView; var LeftRightView = require('../views').LeftRightView; var ModalAlert = require('../views').ModalAlert; -var NAV_EVENT_DELAY = 300; - var MultiView = Backbone.View.extend({ tagName: 'div', className: 'multiView', // ms to debounce the nav functions - navEventDelay: 1500, + navEventDebounce: 150, // a simple mapping of what childViews we support typeToConstructor: { @@ -50,25 +48,34 @@ var MultiView = Backbone.View.extend({ getPosFunc: function() { return _.debounce(_.bind(function() { this.navForward(); - }, this), NAV_EVENT_DELAY, true); + }, this), this.navEventDebounce, true); }, getNegFunc: function() { return _.debounce(_.bind(function() { this.navBackward(); - }, this), NAV_EVENT_DELAY, true); + }, this), this.navEventDebounce, true); }, navForward: function() { + if (this.currentIndex === this.childViews.length - 1) { + this.hideViewIndex(this.currentIndex); + this.finish(); + return; + } + this.navIndexChange(1); }, navBackward: function() { + if (this.currentIndex === 0) { + return; + } + this.navIndexChange(-1); }, navIndexChange: function(delta) { - console.log('doing nav index change', delta); this.hideViewIndex(this.currentIndex); this.currentIndex += delta; this.showViewIndex(this.currentIndex); @@ -82,6 +89,11 @@ var MultiView = Backbone.View.extend({ this.childViews[index].show(); }, + finish: function() { + // promise resolve?? + console.log('promise resolve :D'); + }, + createChildView: function(viewJSON) { var type = viewJSON.type; if (!this.typeToConstructor[type]) { diff --git a/src/style/main.css b/src/style/main.css index 9860cbc2..279cae92 100644 --- a/src/style/main.css +++ b/src/style/main.css @@ -463,6 +463,11 @@ li.rebaseEntry.notPicked { cursor: pointer; } +.leftRightView div.hideLeft i { + cursor: default; + opacity: 0; +} + .leftRightView div { margin: 0 20px; }