~lutostag/ubuntu/utopic/maas/1.5.2

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/build/dom-size/dom-size.js

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-03-15 18:14:08 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120315181408-zgl94hzo0x4n99an
Tags: 0.1+bzr295+dfsg-0ubuntu2
* debian/patches:
  - 01-fix-database-settings.patch: Update to set PSERV_URL.
  - 02-pserv-config.patch: Set port to 8001.
* debian/maas.postinst: Run maas-import-isos on install.
* debian/control: Depends on rabbitmq-server.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
YUI 3.4.1 (build 4118)
 
3
Copyright 2011 Yahoo! Inc. All rights reserved.
 
4
Licensed under the BSD License.
 
5
http://yuilibrary.com/license/
 
6
*/
 
7
YUI.add('dom-size', function(Y) {
 
8
 
 
9
Y.mix(Y.DOM, {
 
10
    /**
 
11
     * Sets the width of the element to the given size, regardless
 
12
     * of box model, border, padding, etc.
 
13
     * @method setWidth
 
14
     * @param {HTMLElement} element The DOM element. 
 
15
     * @param {String|Int} size The pixel height to size to
 
16
     */
 
17
 
 
18
    setWidth: function(node, size) {
 
19
        Y.DOM._setSize(node, 'width', size);
 
20
    },
 
21
 
 
22
    /**
 
23
     * Sets the height of the element to the given size, regardless
 
24
     * of box model, border, padding, etc.
 
25
     * @method setHeight
 
26
     * @param {HTMLElement} element The DOM element. 
 
27
     * @param {String|Int} size The pixel height to size to
 
28
     */
 
29
 
 
30
    setHeight: function(node, size) {
 
31
        Y.DOM._setSize(node, 'height', size);
 
32
    },
 
33
 
 
34
    _setSize: function(node, prop, val) {
 
35
        val = (val > 0) ? val : 0;
 
36
        var size = 0;
 
37
 
 
38
        node.style[prop] = val + 'px';
 
39
        size = (prop === 'height') ? node.offsetHeight : node.offsetWidth;
 
40
 
 
41
        if (size > val) {
 
42
            val = val - (size - val);
 
43
 
 
44
            if (val < 0) {
 
45
                val = 0;
 
46
            }
 
47
 
 
48
            node.style[prop] = val + 'px';
 
49
        }
 
50
    }
 
51
});
 
52
 
 
53
 
 
54
}, '3.4.1' ,{requires:['dom-core']});