~ubuntu-branches/ubuntu/lucid/loggerhead/lucid-security

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): James Westby, Roland Mas, Jelmer Vernooij, James Westby
  • Date: 2009-08-26 13:18:03 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090826131803-0ce1fhaetci8b0c5
Tags: 1.17-0ubuntu1
[ Roland Mas ]
* Use the YUI library provided by libjs-yui. (Closes: #511286)

[ Jelmer Vernooij ]
* Use my debian.org address in Uploaders field.
* Add ${misc:Depends} to please lintian.
* Suggest recent version of paste, which doesn't expose internal port
  numbers in links. (Closes: #507000)
* Bump standards version to 3.8.1.

[ James Westby ]
* New upstream release.
* Drop get-orig-source rule in favour of debian/watch.
* Add python-pkg-resources and python-paste to Build-Depends,
  python-pkg-resources to Depends and python-simplejson to
  Recommends due to dependency changes.

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-constrain', function(Y) {
8
8
 
14
14
    /**
15
15
     * This class extends the dd-drag module to add the constraining methods to it. It supports constraining to a region, node or viewport. It also
16
16
     * supports tick based moves and XY axis constraints.
17
 
     * @class DragConstained
 
17
     * @class DragConstrained
18
18
     * @extends Drag
19
19
     * @constructor
20
20
     */
29
29
 
30
30
    };
31
31
    
32
 
    C.NAME = 'DragConstrained';
 
32
    C.NAME = 'dragConstrained';
33
33
 
34
34
    C.ATTRS = {
35
35
        /**
179
179
            var r = {};
180
180
            if (this.get('constrain2node')) {
181
181
                if (!this._regionCache) {
182
 
                    Y.Event.addListener('window', 'resize', this._cacheRegion, this);
 
182
                    Y.on('resize', this._cacheRegion, this, true, window);
183
183
                    this._cacheRegion();
184
184
                }
185
185
                r = Y.clone(this._regionCache);
218
218
                r = this.getRegion(),
219
219
                oh = this.get(DRAG_NODE).get(OFFSET_HEIGHT),
220
220
                ow = this.get(DRAG_NODE).get(OFFSET_WIDTH);
221
 
 
222
 
            if (r.top > oxy[1]) {
223
 
                oxy[1] = r.top;
224
 
 
225
 
            }
226
 
            if (oxy[1] > (r.bottom - oh)) {
227
 
                oxy[1] = (r.bottom - oh);
228
 
            }
229
 
            if (r.left > oxy[0]) {
230
 
                oxy[0] = r.left;
231
 
            }
232
 
            if (oxy[0] > (r.right - ow)) {
233
 
                oxy[0] = (r.right - ow);
234
 
            }
235
 
 
236
 
            return oxy;
 
221
            
 
222
                if (oxy[1] > (r.bottom - oh)) {
 
223
                    _xy[1] = (r.bottom - oh);
 
224
                }
 
225
                if (r.top > oxy[1]) {
 
226
                    _xy[1] = r.top;
 
227
 
 
228
                }
 
229
                if (oxy[0] > (r.right - ow)) {
 
230
                    _xy[0] = (r.right - ow);
 
231
                }
 
232
                if (r.left > oxy[0]) {
 
233
                    _xy[0] = r.left;
 
234
                }
 
235
 
 
236
            return _xy;
237
237
        },
238
238
        /**
239
239
        * @method inRegion
261
261
        _align: function(xy) {
262
262
            var _xy = C.superclass._align.apply(this, arguments),
263
263
                r = this.getRegion(true);
 
264
 
264
265
            if (this.get('stickX')) {
265
266
                _xy[1] = (this.startXY[1] - this.deltaXY[1]);
266
267
            }
382
383
 
383
384
 
384
385
 
385
 
}, '3.0.0pr1' ,{requires:['dd-drag', 'dd-proxy'], skinnable:false});
 
386
}, '3.0.0pr2' ,{requires:['dd-drag', 'dd-proxy'], skinnable:false});