Exemple #1
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);
       }
     }
   }
 }
Exemple #2
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);
        }
      }
    }
  }