Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Remote.TabSet = Behavior.create({
- initialize: function () {
- this.select_tab(this.element.select('li.tab').last())
- },
- onclick: function (e) {
- e.stop();
- var tab = e.findElement('li') || this.element.select('li.tab.active').first();
- if (tab.hasClassName('active'))
- return false;
- this.element.select('li.tab').invoke('removeClassName', 'active')
- this.select_tab(tab);
- e.stop();
- },
- select_tab: function (tab) {
- tab.addClassName('active')
- new Ajax.Updater('dashboard_content', tab.select('a').first().href, {method: 'get', asynchronous:true, evalScripts:true})
- }
- });
Add Comment
Please, Sign In to add comment