fix drag-n-drop uploader docs

This commit is contained in:
Leon Sorokin 2015-03-16 23:43:22 -05:00
parent 0ea9fac07e
commit f0c0c3c0be

View file

@ -634,10 +634,11 @@ var Uploader = {
}) })
}, },
view: function(ctrl, args) { view: function(ctrl, args) {
var self = this;
return m(".uploader", { return m(".uploader", {
config: function(element, isInitialized) { config: function(element, isInitialized) {
if (!isInitialized) { if (!isInitialized) {
dragdrop(element, {onchange: args.onchange}) self.dragdrop(element, {onchange: args.onchange})
} }
} }
}) })
@ -652,12 +653,12 @@ var Demo = {
this.upload = function() { this.upload = function() {
Uploader.upload(this.files()) Uploader.upload(this.files())
}.bind(this) }.bind(this)
} },
view: function(ctrl) { view: function(ctrl) {
return [ return [
m("h1", "Uploader demo"), m("h1", "Uploader demo"),
m.module(Uploader, {onchange: ctrl.files}) m.module(Uploader, {onchange: ctrl.files}),
m("button[type=button]", {onclick: ctrl.upload}) m("button[type=button]", {onclick: ctrl.upload}, "Upload")
] ]
} }
} }