Exemplo n.º 1
0
 public void unbind(String events, Function f) {
   for (EventName ev : EventName.split(events)) {
     SpecialEvent hook = special.get(ev.eventName);
     boolean unbind = hook == null || hook.tearDown(element) == false;
     if (unbind) {
       unbind(Event.getTypeInt(ev.eventName), ev.nameSpace, ev.eventName, f);
     }
     if (hook != null) {
       hook.remove(element, ev.eventName, ev.nameSpace, f);
     }
   }
 }
Exemplo n.º 2
0
 public void die(String events, String cssSelector) {
   for (EventName ev : EventName.split(events)) {
     SpecialEvent hook = special.get(ev.eventName);
     boolean unbind = hook == null || hook.tearDown(element) == false;
     if (unbind) {
       die(Event.getTypeInt(ev.eventName), ev.nameSpace, ev.eventName, cssSelector);
     }
     if (hook != null) {
       hook.remove(element, ev.eventName, ev.nameSpace, null);
     }
   }
 }
Exemplo n.º 3
0
 public void live(String events, String cssSelector, Object data, Function... funcs) {
   for (EventName ev : EventName.split(events)) {
     SpecialEvent hook = special.get(ev.eventName);
     boolean bind = hook == null || hook.setup(element) == false;
     for (Function function : funcs) {
       int b = Event.getTypeInt(ev.eventName);
       if (bind) {
         live(b, ev.nameSpace, ev.eventName, cssSelector, data, function);
       }
       if (hook != null) {
         hook.add(element, ev.eventName, ev.nameSpace, data, function);
       }
     }
   }
 }
Exemplo n.º 4
0
  public void bind(String events, final Object data, Function... funcs) {
    if (funcs.length == 0 || funcs[0] == null) {
      unbind(events, null);
    }

    for (EventName ev : EventName.split(events)) {
      SpecialEvent hook = special.get(ev.eventName);
      boolean bind = hook == null || hook.setup(element) == false;
      for (Function function : funcs) {
        int b = Event.getTypeInt(ev.eventName);
        if (bind) {
          bind(b, ev.nameSpace, ev.eventName, data, function, -1);
        }
        if (hook != null) {
          hook.add(element, ev.eventName, ev.nameSpace, data, function);
        }
      }
    }
  }