Changeset 684
- Timestamp:
- 06/19/07 05:23:43 (1 year ago)
- Location:
- trunk/Plugins
- Files:
-
- 4 modified
-
Group.js (modified) (1 diff)
-
Hash.Cookie.js (modified) (1 diff)
-
Slider.js (modified) (1 diff)
-
Sortables.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Plugins/Group.js
r588 r684 29 29 xhr3.request(); 30 30 (end) 31 32 31 */ 33 32 -
trunk/Plugins/Hash.Cookie.js
r500 r684 95 95 }; 96 96 }); 97 97 98 Hash.Cookie.implement(Hash.Cookie.Methods); -
trunk/Plugins/Slider.js
r673 r684 144 144 }); 145 145 146 Slider.implement(new Events); 147 Slider.implement(new Options); 146 Slider.implement(new Events, new Options); -
trunk/Plugins/Sortables.js
r683 r684 13 13 Arguments: 14 14 list - required, the list or lists that will become sortable. 15 This argument can be a string id, an element, or an object or array of either strings or elements. When a single 16 list (or id) is passed, that list will be sortable only with itself. To enable sorting between lists, one or more 17 lists or id's must be passed using an array or an object. See Examples below. 15 This argument can be an Element, or array of Elements. When a single list (or id) is passed, that list will be sortable only with itself. 16 To enable sorting between lists, one or more lists or id's must be passed using an array or an object. See Examples below. 18 17 options - an Object, see options and events below. 19 18 20 19 Options: 20 constrain - whether or not to constrain the element being dragged to its parent element. defaults to false. 21 21 clone - whether or not to display a copy of the actual element while dragging. defaults to true. 22 22 cloneOpacity - opacity of the place holding element 23 23 elementOpacity - opacity of the element being dragged for sorting 24 revert - whether or not to use an effect to slide the element into its final location after sorting. defaults to false.25 revertOptions - an object specifying extra options to be passed to the revert effect, if used.26 24 handle - a selector which be used to select the element inside each item to be used as a handle for sorting that item. if no match is found, the element is used as its own handle. 27 constrain - whether or not to constrain the element being dragged to its parent element. defaults to false.25 revert - whether or not to use an effect to slide the element into its final location after sorting. If you pass an object it will be treated as true and used as aditional options for the revert effect. defaults to false. 28 26 29 27 Events: … … 34 32 (start code) 35 33 var mySortables = new Sortables('list-1', { 36 revert: true, 37 revertOptions: {duration: 500, transition: Fx.Transitions.Elastic.easeOut} 34 revert: { duration: 500, transition: Fx.Transitions.Elastic.easeOut } 38 35 }); 39 36 //creates a new Sortable instance over the list with id 'list-1' with some extra options for the revert effect 37 38 var mySortables = new Sortables(['list-1', 'list-2'], { 39 constrain: true, 40 clone: false, 41 revert: true 42 }); 43 //creates a new Sortable instance allowing the sorting of the lists with id's 'list-1' and 'list-2' with extra options 44 //since constrain was set to false, the items will not be able to be dragged from one list to the other 40 45 41 46 var mySortables = new Sortables(['list-1', 'list-2', 'list-3']); 42 47 //creates a new Sortable instance allowing sorting between the lists with id's 'list-1', 'list-2, and 'list-3' 43 48 (end) 44 45 49 */ 46 50 … … 62 66 this.setOptions(options); 63 67 this.idle = true; 64 this.lists = [];65 68 this.hovering = false; 66 69 this.newInsert = false; 70 this.revert = this.options.revert ? $merge({ duration: 250, wait: false }, this.options.revert) : false; 67 71 this.bound = { 68 72 'start': [], … … 72 76 73 77 switch($type(lists)){ 74 case 'array': for (var i = 0, l = lists.length; i < l; i++) this.lists[i] = $(lists[i]); break; 75 case 'object': for (var e in lists) this.lists.push($(lists[e])); break; 76 case 'string': case 'element': this.lists.push($(lists)); break; 77 default: return; 78 case 'string': case 'element': this.lists = $splat($(lists)); break; 79 case 'array': this.lists = $$(lists); break; 78 80 } 79 81 … … 267 269 this.reposition(); 268 270 269 if (!this. options.revert) this.reset();271 if (!this.revert) this.reset(); 270 272 else { 271 if (!this.effect) this.effect = this.element.effects( $merge(this.options.revertOptions, {wait: false, onComplete: this.reset.bind(this)}));273 if (!this.effect) this.effect = this.element.effects(this.revert).addEvent('onComplete', this.reset.bind(this)); 272 274 else this.effect.element = this.element; 273 275 this.effect.start({