Skip to content

Instantly share code, notes, and snippets.

@thomasJang
Created August 23, 2015 15:11
Show Gist options
  • Save thomasJang/43d2d87470633d70b7da to your computer and use it in GitHub Desktop.
Save thomasJang/43d2d87470633d70b7da to your computer and use it in GitHub Desktop.
find event - axisj
this.els["control"].bind("click", function (e) {
e = e || window.event;
var btn_value;
var target = axf.get_event_target(e.target, function (el) {
if ('getAttribute' in el) {
if (btn_value = el.getAttribute("data-els-btn")) {
return true;
}
}
});
if (target && btn_value) {
if (btn_value == "add-artcle") {
_this.add_artcle(_this.els["control-add-type"].val());
}
else if (btn_value == "move-up-artcle") {
_this.move_artcle(target.getAttribute("data-article-index"), "up");
}
else if (btn_value == "move-down-artcle") {
_this.move_artcle(target.getAttribute("data-article-index"), "down");
}
else if (btn_value == "remove-artcle") {
_this.remove_artcle(target.getAttribute("data-article-index"));
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment