Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add js for mode switch

  • Loading branch information...
commit e096f98c300269dc16d3287336d33edf621ecda2 1 parent 9bda405
maxbbn authored

Showing 1 changed file with 27 additions and 0 deletions. Show diff stats Hide diff stats

  1. +27 0 public/javascripts/star/mode.js
27 public/javascripts/star/mode.js
... ... @@ -0,0 +1,27 @@
  1 +KISSY.add("star/mode", function(S, Notify){
  2 + var mapper = {
  3 + '/rel' : 'modechange:normal',
  4 + '/rel/master' : 'modechange:marster',
  5 + '/rel/boss' : 'modechange:boss'
  6 + }
  7 +
  8 + S.one("#modes").delegate('click','.act',function(ev){
  9 + var et = S.one(ev.target),
  10 + t, li = et.parent();
  11 + if(li.hasClass('selected')) return;
  12 + var action = mapper[et.attr('data-type')];
  13 + if(!action) return;
  14 + S.all("#modes li").removeClass('selected');
  15 +
  16 + t = action.split(':');
  17 + Notify.fire(t[0], {
  18 + data : t[1]
  19 + });
  20 +
  21 + li.addClass('selected');
  22 +
  23 + });
  24 +
  25 +},{
  26 + requires : ['star/notify','sizzle']
  27 +});

0 comments on commit e096f98

Please sign in to comment.
Something went wrong with that request. Please try again.