~jstys-z/helioviewer.org/client5

« back to all changes in this revision

Viewing changes to lib/helioviewer/IconPicker.js

  • Committer: V. Keith Hughitt
  • Date: 2009-04-01 21:08:05 UTC
  • Revision ID: hughitt1@kore-20090401210805-372f7dgih07vxk42
nightly build 04-01-2009

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
                
22
22
                // Keep track of which event-layer is being targeted.
23
23
                this.focus = null;
 
24
        
 
25
        // Don't build until requested
 
26
        this.loaded = false;
24
27
                
25
28
                // Build icon-list
26
 
                this._buildIconList();
 
29
                //this._buildIconList();
27
30
        },
28
31
        
29
32
        
32
35
         */
33
36
        _buildIconList: function () {
34
37
                var i, closeBtn, menu, self = this;
35
 
                menu = jQuery("<div id='" + this.id + "' style='display: none;'></div>");                               
36
 
                menu.append(jQuery('<div id=event-icon-menu-title><span style="vertical-align: middle">Chose an icon:</span></div><div id="event-icon-menu-body">'));
 
38
                menu = jQuery("<div id='" + this.id + "' class='ui-widget ui-widget-content ui-corner-all' style='display: none;'></div>");                             
 
39
                //menu.append(jQuery('<div id=event-icon-menu-title><span style="vertical-align: middle">Chose an icon:</span></div><div id="event-icon-menu-body">'));
 
40
        menu.append(jQuery('<div id=event-icon-menu-title><span style="vertical-align: middle">Chose an icon:</span></div><div id="event-icon-menu-body">'));
37
41
 
38
42
                i = 1;
39
43
                this.AVAILABLE_ICON_COLORS.each(function (color) {
51
55
                        });                     
52
56
                });
53
57
                
54
 
                closeBtn = jQuery('<br><div style="text-align: right"><a class="event-url" href="#" style="margin-right: 2px;">[Close]</a></div>').click(function () {
 
58
                closeBtn = jQuery('<br><div style="text-align: right"><a class="light" href="#" style="margin-right: 2px;">[Close]</a></div>').click(function () {
55
59
                        jQuery('#event-icon-menu').fadeOut();
56
60
                });
57
61
                menu.append(closeBtn);
66
70
         * @param {Object} pos The mouse-click position
67
71
         */
68
72
        toggle: function (layer, pos) {
69
 
                this.focus = layer;
 
73
        if (!this.loaded) {
 
74
            this._buildIconList();            
 
75
            this.loaded = true;
 
76
        }
 
77
                this.focus = layer;
70
78
                jQuery('#' + this.id).css({'left': pos.left + 16, 'top': pos.top + 16}).slideToggle();
 
79
 
71
80
        }
72
81
});