got boudns working

This commit is contained in:
Peter Cottle 2012-12-24 12:42:39 -08:00
parent 7acde81510
commit d825573ef9
4 changed files with 60 additions and 19 deletions

View file

@ -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]) {

View file

@ -163,7 +163,7 @@
<% if (showLeft) { %>
<div class="box left">
<% } else { %>
<div class="box left" style="opacity: 0; cursor: default">
<div class="box left hideLeft">
<% } %>
<i class="icon-circle-arrow-left"></i>
</div>

View file

@ -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]) {

View file

@ -463,6 +463,11 @@ li.rebaseEntry.notPicked {
cursor: pointer;
}
.leftRightView div.hideLeft i {
cursor: default;
opacity: 0;
}
.leftRightView div {
margin: 0 20px;
}