Active tabs

Gary Poster gary.poster at canonical.com
Thu Aug 1 15:19:07 UTC 2013


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
> 
> 




More information about the Juju-GUI mailing list