GIANT modal view update amazing

This commit is contained in:
Peter Cottle 2012-12-19 23:13:42 -08:00
parent ce37b7fae4
commit 3d0861bd4f
6 changed files with 356 additions and 171 deletions

View file

@ -3,7 +3,10 @@ var _ = require('underscore');
// horrible hack to get localStorage Backbone plugin
var Backbone = (!require('../util').isBrowser()) ? Backbone = require('backbone') : Backbone = window.Backbone;
var InteractiveRebaseView = Backbone.View.extend({
var ModalTerminal = require('../views').ModalTerminal;
var BaseView = require('../views').BaseView;
var InteractiveRebaseView = BaseView.extend({
tagName: 'div',
template: _.template($('#interactive-rebase-template').html()),
@ -32,24 +35,16 @@ var InteractiveRebaseView = Backbone.View.extend({
this.rebaseEntries.add(this.entryObjMap[id]);
}, this);
this.container = new ModalTerminal({
title: 'Interactive Rebase'
});
this.render();
// show the dialog holder
this.show();
},
show: function() {
this.toggleVisibility(true);
},
hide: function() {
this.toggleVisibility(false);
},
toggleVisibility: function(toggle) {
this.$el.toggleClass('shown', toggle);
},
confirmed: function() {
// we hide the dialog anyways, but they might be fast clickers
if (this.hasClicked) {
@ -86,7 +81,9 @@ var InteractiveRebaseView = Backbone.View.extend({
num: this.rebaseArray.length
};
var destination = this.container.getInsideElement();
this.$el.html(this.template(json));
$(destination).append(this.el);
// also render each entry
var listHolder = this.$('ul#rebaseEntries');