/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

Viewing changes to loggerhead/static/javascript/yui/build/dd/dd-ddm-drop.js

  • Committer: Martin Albisetti
  • Date: 2008-12-30 19:20:39 UTC
  • Revision ID: argentina@gmail.com-20081230192039-kc2spvli08fo09sx
Upgrade YUI3 to PR2

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3
3
Code licensed under the BSD License:
4
4
http://developer.yahoo.net/yui/license.txt
5
 
version: 3.0.0pr1
 
5
version: 3.0.0pr2
6
6
*/
7
7
YUI.add('dd-ddm-drop', function(Y) {
8
8
 
265
265
        */
266
266
        _deactivateTargets: function() {
267
267
            var other = [],
268
 
                activeDrag = this.activeDrag;
 
268
                activeDrag = this.activeDrag,
 
269
                activeDrop = this.activeDrop;
269
270
            
270
271
            //TODO why is this check so hard??
271
 
            if (activeDrag && !Y.Lang.isNull(this.activeDrop) && this.otherDrops[this.activeDrop]) {
 
272
            if (activeDrag && activeDrop && this.otherDrops[activeDrop]) {
272
273
                if (!activeDrag.get('dragMode')) {
273
274
                    //TODO otherDrops -- private..
274
275
                    other = this.otherDrops;
275
 
                    delete other[this.activeDrop];
 
276
                    delete other[activeDrop];
276
277
                } else {
277
278
                    var tmp = this.getBestMatch(this.otherDrops, true);
278
 
                    this.activeDrop = tmp[0];
 
279
                    activeDrop = tmp[0];
279
280
                    other = tmp[1];
280
281
                }
281
282
                activeDrag.get('node').removeClass(this.CSS_PREFIX + '-drag-over')
282
 
                this.activeDrop.fire('drop:hit', { drag: activeDrag, drop: this.activeDrop, others: other });
283
 
                activeDrag.fire('drag:drophit', { drag: activeDrag,  drop: this.activeDrop, others: other });
284
 
            } else if (this.activeDrag) {
 
283
                if (activeDrop) {
 
284
                    activeDrop.fire('drop:hit', { drag: activeDrag, drop: activeDrop, others: other });
 
285
                    activeDrag.fire('drag:drophit', { drag: activeDrag,  drop: activeDrop, others: other });
 
286
                }
 
287
            } else if (activeDrag) {
285
288
                activeDrag.get('node').removeClass(this.CSS_PREFIX + '-drag-over')
286
289
                activeDrag.fire('drag:dropmiss', { pageX: activeDrag.lastXY[0], pageY: activeDrag.lastXY[1] });
287
290
            } else {
396
399
 
397
400
 
398
401
 
399
 
}, '3.0.0pr1' ,{requires:['dd-ddm'], skinnable:false});
 
402
}, '3.0.0pr2' ,{requires:['dd-ddm'], skinnable:false});