Guest User

Untitled

a guest
Jun 22nd, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. Remote.TabSet = Behavior.create({
  2. initialize: function () {
  3. this.select_tab(this.element.select('li.tab').last())
  4. },
  5.  
  6. onclick: function (e) {
  7. e.stop();
  8. var tab = e.findElement('li') || this.element.select('li.tab.active').first();
  9. if (tab.hasClassName('active'))
  10. return false;
  11.  
  12. this.element.select('li.tab').invoke('removeClassName', 'active')
  13. this.select_tab(tab);
  14. e.stop();
  15. },
  16.  
  17. select_tab: function (tab) {
  18. tab.addClassName('active')
  19. new Ajax.Updater('dashboard_content', tab.select('a').first().href, {method: 'get', asynchronous:true, evalScripts:true})
  20. }
  21. });
Add Comment
Please, Sign In to add comment