~ubuntu-branches/ubuntu/raring/maas/raring-updates

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/build/scrollview-list/scrollview-list-debug.js

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-07-03 17:42:37 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120703174237-p8l0keuuznfg721k
Tags: 0.1+bzr709+dfsg-0ubuntu1
* New Upstream release
* debian/control:
  - Depends on python-celery, python-tempita, libjs-yui3-{full,min},
    libjs-raphael
* debian/maas.install:
  - Install apiclient, celeryconfig.py, maas-import-pxe-files, preseeds_v2.
  - Update to install various files from chroot, rather tha manually copy
    them from the source.
* debian/maas.links: symlink celeryconfig.py
* debian/maas.maas-celery.upstart: Add job.
* debian/rules:
  - Install celery upstart job.
  - Do not install jslibs as packages are now used.
  - Drop copying of maas_local_settings_sample.py as source now ships
    a maas_local_settings.py
* debian/patches:
  - 04-maas-http-fix.patch: Drop. Merged upstream.
  - 01-fix-database-settings.patch: Refreshed.
  - 99_enums_js.patch: Added until creation of enum.js / build process
    is fixed.
* debian/maas.postinst: Update bzr version to correctly handle upgrades.

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('scrollview-list', function(Y) {
8
 
 
9
 
/**
10
 
 * Provides a plugin, which adds support for a scroll indicator to ScrollView instances
11
 
 *
12
 
 * @module scrollview-list
13
 
 */
14
 
var getCN = Y.ClassNameManager.getClassName,
15
 
SCROLLVIEW = 'scrollview',
16
 
LIST_CLASS = getCN(SCROLLVIEW, 'list'),
17
 
ITEM_CLASS = getCN(SCROLLVIEW, 'item'),
18
 
CONTENT_BOX = "contentBox",
19
 
RENDERED = 'rendered',
20
 
RENDER_UI = 'renderUI',
21
 
HOST = "host";
22
 
 
23
 
/**
24
 
 * ScrollView plugin that adds class names to immediate descendant "<li>" to 
25
 
 * allow for easier styling through CSS
26
 
 *
27
 
 * @class ScrollViewList
28
 
 * @namespace Plugin
29
 
 * @extends Plugin.Base
30
 
 * @constructor
31
 
 */
32
 
function ListPlugin() {
33
 
    ListPlugin.superclass.constructor.apply(this, arguments);
34
 
}
35
 
 
36
 
 
37
 
/**
38
 
 * The identity of the plugin
39
 
 *
40
 
 * @property NAME
41
 
 * @type String
42
 
 * @default 'pluginList'
43
 
 * @static
44
 
 */
45
 
ListPlugin.NAME = 'pluginList';
46
 
    
47
 
/**
48
 
 * The namespace on which the plugin will reside.
49
 
 *
50
 
 * @property NS
51
 
 * @type String
52
 
 * @default 'list'
53
 
 * @static
54
 
 */
55
 
ListPlugin.NS = 'list';
56
 
 
57
 
 
58
 
/**
59
 
 * The default attribute configuration for the plugin
60
 
 *
61
 
 * @property ATTRS
62
 
 * @type Object
63
 
 * @static
64
 
 */
65
 
ListPlugin.ATTRS = {
66
 
    
67
 
    /**
68
 
     * Specifies whether the list elements (the immediate <ul>'s and the immediate <li>'s inside those <ul>'s) have class names attached to them or not
69
 
     *
70
 
     * @attribute isAttached
71
 
     * @type boolean
72
 
     * @deprecated No real use for this attribute on the public API
73
 
     */
74
 
    isAttached: {
75
 
        value:false,
76
 
        validator: Y.Lang.isBoolean
77
 
    }
78
 
};
79
 
 
80
 
Y.namespace("Plugin").ScrollViewList = Y.extend(ListPlugin, Y.Plugin.Base, {
81
 
 
82
 
    /**
83
 
     * Designated initializer
84
 
     *
85
 
     * @method initializer
86
 
     */
87
 
    initializer: function() {
88
 
        this._host = this.get(HOST);
89
 
        this.afterHostEvent("render", this._addClassesToList);
90
 
    },
91
 
 
92
 
    _addClassesToList: function() {
93
 
        if (!this.get('isAttached')) {
94
 
            var cb = this._host.get(CONTENT_BOX),
95
 
            ulList,
96
 
            liList;
97
 
 
98
 
            if (cb.hasChildNodes()) {
99
 
                //get all direct descendants of the UL's that are directly under the content box.
100
 
                ulList = cb.all('> ul');
101
 
                liList = cb.all('> ul > li');
102
 
 
103
 
                //go through the UL's and add the class
104
 
                ulList.each(function(list) {
105
 
                    list.addClass(LIST_CLASS);
106
 
                });
107
 
 
108
 
                //go through LI's and add the class
109
 
                liList.each(function(item) {
110
 
                    item.addClass(ITEM_CLASS);
111
 
                });
112
 
 
113
 
                this.set('isAttached', true);
114
 
                
115
 
                // We need to call this again, since sv-list 
116
 
                // relies on the "-vert" class, to apply padding.
117
 
                // [ 1st syncUI pass applies -vert, 2nd pass re-calcs dims ] 
118
 
                this._host.syncUI();
119
 
            }
120
 
        }
121
 
    }
122
 
 
123
 
});
124
 
 
125
 
 
126
 
 
127
 
 
128
 
 
129
 
 
130
 
 
131
 
 
132
 
 
133
 
 
134
 
 
135
 
 
136
 
}, '3.4.1' ,{requires:['plugin', 'classnamemanager'], skinnable:true});