Last active
August 29, 2015 14:12
-
-
Save mizhdi/6867f2346651423da221 to your computer and use it in GitHub Desktop.
常用j s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1 | |
var htmlSurpriseTab = [ | |
'<div>', | |
'<button id="lucky-draw">Lucky Draw</button>', | |
'</div>' | |
].join(''); | |
// 2 | |
actionList[actionName] && actionList[actionName].call(this,event); | |
// 3 | |
CMUI.dialog = { | |
template: [ | |
'<div class="dialog">', | |
'<a href="#" data-action="close-dialog">×</a>', | |
'<h2><%= data.title %></h2>', | |
'<div class="content"><%- data.html %></div>', | |
'</div>' | |
].join(''), | |
init: function () { | |
action.add({ | |
'close-dialog': function () { | |
$(this).closest('.dialog').hide() | |
} | |
}) | |
}, | |
open: function (config) { | |
var html = render(this.template, config) | |
$(html).appendTo('body').show() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment