diff -r f7667a1dde8e -r b33516ab03e8 src/js/layout.js --- a/src/js/layout.js Wed Dec 28 17:06:46 2011 +0100 +++ b/src/js/layout.js Wed Dec 28 17:07:20 2011 +0100 @@ -71,55 +71,4 @@ this.selector.append(spacerCode); return [newDiv, spacerDiv]; -}; - -/** return a new slice - @return an IriSP.LayoutManager.sliceObject -*/ -IriSP.LayoutManager.prototype.slice = function(widget) { - var end = (this._widgets.length > 0) ? this._widgets.length - 1 : 0; - var s = new IriSP.LayoutManager.sliceObject(0, end, this) - return s; -}; - -/** sliceObjects represent a group of widget managed by a layout manager. - They expose convenient methods for selecting portions of widgets - They can be chained in this way : - layoutManager.slice().before("ArrowWidget").after("PolemicWidget"); -*/ -IriSP.LayoutManager.sliceObject = function(start, end, layoutManager) { - this.start = start; - this.end = end; - this._layoutManager = layoutManager; -}; - -/** returns a slice of the array corresponding to the objects after widget - @param widget the widget to filter with */ -IriSP.LayoutManager.sliceObject.prototype.after = function(widget) { - var i; - for(i = this.start; i < this.end; i++) - if (this._layoutManager._widgets[i][0] === widget) - break; - - this.start = i; - console.log(this.start); - return this; -} - -/** returns a slice of the array corresponding to the objects before widget - @param widget the widget to filter with */ -IriSP.LayoutManager.sliceObject.prototype.before = function(widget) { - var i; - for(i = this.start; i < this.end; i++) - if (this._layoutManager._widgets[i][0] === widget) - break; - - this.end = i; - - return this; -} - -/** return a jquery selector corresponding to the defined slice */ -IriSP.LayoutManager.sliceObject.prototype.jQuerySelector = function() { - return this._layoutManager.selector.children("").slice(this.start, this.end); }; \ No newline at end of file