Sha256: 5b2ef72b249a66e2ae45ab1145aa277c33e698e6047389bddf015e69765a2c2c

Contents?: true

Size: 1.1 KB

Versions: 20

Compression:

Stored size: 1.1 KB

Contents

var QuickEditStack = new Class({
	version: 0.1,

	options: {
	},
	bricksArray: [],
	bricksIndex: 0,

	Implements: [Options, Events],

	initialize: function(_options) {
		this.setOptions(_options);
	},
	addEditBrick: function(editOptions, link, linkParent){
		var qi = this.bricksIndex;
		var qe = this.bricksArray[qi];
		if ( ! qe) {
			qe = new QuickEdit(editOptions);
			this.bricksArray.push(qe);
		}
		
		this.bricksArray.each(function(b, i){
			if (i === qi) {
				b.show();
			}
			else if (i > qi) {
				b.close();
			}
		});
		
		qe.addEvents(this.options.permanentQuickEditEvents);
		qe.startEdit(link);
	},
	addStack: function(){
		this.bricksIndex = this.bricksIndex + 1;
		this.bricksArray.each(function(b){
			b.hide();
		});
	},
	removeStack: function(){
		this.bricksArray[this.bricksIndex] = undefined;
		this.bricksIndex = this.bricksIndex - 1;
		this.bricksArray = this.bricksArray.clean();
		(this.bricksArray.getLast() || {show: function(){}}).show();
	},
	removeAllStacks: function(){
		this.bricksArray.clean().each(function(b, i){
			b.close();
		});
		this.bricksArray = [];
		this.bricksIndex = 0;
	}
});

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
bhf-0.10.12 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.10.11 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.10.10 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.10.9 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.9.9 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.9.8 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.9.7 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.9.6 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.9.5 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.9.4 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.9.3 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.9.2 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.9.1 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.9.0 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.8.7 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.8.6 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.8.5 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.8.4 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.8.3 app/assets/javascripts/bhf/classes/QuickEditStack.js
bhf-0.8.2 app/assets/javascripts/bhf/classes/QuickEditStack.js