Skip to content

Instantly share code, notes, and snippets.

@jforaker
Created April 10, 2014 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jforaker/10428627 to your computer and use it in GitHub Desktop.
Save jforaker/10428627 to your computer and use it in GitHub Desktop.
Multiple tap listeners
listeners: {
tap: {
element: 'element',
delegate: '.app-box, .doc-box, .bubble-holder',
fn: function(e){
var url = e.target.name
, name = e.delegatedTarget.textContent
, divClassName = e.delegatedTarget.className
, appbox = "app-box"
, docbox = "doc-box"
, bubble = "bubble-holder"
, feedAppController = CHLK._app.getController('feed.FeedItemViewController');
switch(divClassName){
case docbox :
var me = this,
config = {
title: "Attachment downloaded",
message: name,
buttons: [{
id: 'MsgConfirm',
disabled: false
}],
scope: me
};
Ext.ux.plugin.AutoHideMessageBox.alert(config);
break;
case appbox :
feedAppController.loadTheApp(url, name);
break;
case bubble :
feedAppController.showCommentPop(this);
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment