Active tabs

Jeff Pihach jeff.pihach at canonical.com
Thu Aug 1 15:26:22 UTC 2013


docs...docs....what are these `docs` that you speak of? :-)

The viewlet system was refactored quite heavily from when the current 
docs were written but I'm pretty confident the architecture of the 
viewlet system won't be changing any more so I'll make a card to update 
these docs.

Jeff

Gary Poster wrote:
> Thanks, Jeff.
>
> Does the viewlet doc clarify this?  If so, let's point Huw to it.  If
> not, let's clarify it, and then point Huw to it. :-)
>
> Thanks
>
> Gary
>
>
> On 08/01/2013 09:43 AM, Jeff Pihach wrote:
>> Hi Huw,
>>
>> Yes that's to be expected, if you want that method to be called it will
>> need to be in the viewlet-manager. Ping me when you get back in and I
>> can run you through the different event objects and where they relate to.
>>
>> -Jeff
>>
>> Huw Wilkins wrote:
>>> Hi,
>>>
>>> In the inspector I need to be able to set the current tab (currently S
>>> C E D) to an active icon. However I'm not sure how to get the fired
>>> event to call the function. Diff here:
>>>
>>> === modified file 'app/views/environment.js'
>>> --- app/views/environment.js2013-07-31 06:10:45 +0000
>>> +++ app/views/environment.js2013-08-01 06:38:27 +0000
>>> @@ -179,7 +179,7 @@
>>>               },
>>>               configService: {
>>>                 events: {
>>> -                '.tab': {'click': 'showViewlet'}
>>> +                '.tab': {'click': '_switchTab'}
>>>                 },
>>>                 viewletEvents: {
>>>                   // Viewlet wrapper viewlet.
>>> @@ -369,6 +369,22 @@
>>>           _attachTopoEvents: function() {
>>>             this.topo.on(
>>>                 '*:destroyServiceInspector', this.destroyInspector, this);
>>> +        },
>>> +
>>> +        /**
>>> +          Switch tab viewlet.
>>> +
>>> +          @method _switchTab
>>> +        */
>>> +        _switchTab: function(ev) {
>>> +          /* This doesn't get run. I want to show the tab and set the
>>> link active here. */
>>> +          ev.halt();
>>> +          var container = this.get('container'),
>>> +              target = ev.currentTarget,
>>> +              state = target.getData('viewlet');
>>> +          this.viewletManager.showViewlet('unitDetails');
>>> +          container.one('tab.active').removeClass('active');
>>> +          target.addClass('active');
>>>           }
>>>         }, {
>>>           ATTRS: {
>>>
>>> Any suggestions?
>>>
>>> Cheers,
>>>
>>> Huw
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-gui/attachments/20130801/1585c12f/attachment-0001.html>


More information about the Juju-GUI mailing list