Fixed uploader demo code
Still needs styling for the drop area to occupy any space though. Worth putting in as inline styles?
This commit is contained in:
parent
0ea9fac07e
commit
837c0241cc
1 changed files with 5 additions and 5 deletions
|
|
@ -637,7 +637,7 @@ var Uploader = {
|
||||||
return m(".uploader", {
|
return m(".uploader", {
|
||||||
config: function(element, isInitialized) {
|
config: function(element, isInitialized) {
|
||||||
if (!isInitialized) {
|
if (!isInitialized) {
|
||||||
dragdrop(element, {onchange: args.onchange})
|
Uploader.dragdrop(element, {onchange: args.onchange})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -648,19 +648,19 @@ var Uploader = {
|
||||||
var Demo = {
|
var Demo = {
|
||||||
controller: function() {
|
controller: function() {
|
||||||
this.files = m.prop([])
|
this.files = m.prop([])
|
||||||
|
|
||||||
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})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m.module(document.body, Demo)
|
m.module(document.body, Demo)
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue