diff --git a/src/core/BaseDialog.coffee b/src/core/BaseDialog.coffee
index c9b7d49..8bd6f2b 100644
--- a/src/core/BaseDialog.coffee
+++ b/src/core/BaseDialog.coffee
@@ -323,7 +323,7 @@ class FileDiaLog extends BaseDialog
return me.notify __("Only {0} could be selected", me.data.mimes.join(",")) unless m
d = f.path
d = f.path.asFileHandler().parent() if f.type is "file"
- me.handler d, ($ filename).val(), f.path if me.handler
+ me.handler d, ($ filename).val(), f.path, f if me.handler
#sel = if me.data and me.data.selection then me.data.selection else "file"
#me.handler f, ($ filename).val() if me.handler and ((f.type is sel) or (sel is "*"))
me.quit()
diff --git a/src/core/tags/afx-switch.tag b/src/core/tags/afx-switch.tag
index feb3901..12f31db 100644
--- a/src/core/tags/afx-switch.tag
+++ b/src/core/tags/afx-switch.tag
@@ -41,12 +41,13 @@
{
if(!self.enable) return
opts.swon = !self.swon
+ self.swon = opts.swon
var data = {
id: self.rid,
data: opts.swon
}
- if(self.onchange)
- self.onchange(data)
+ if(opts.onchange)
+ opts.onchange(data)
if(self.root.observable)
self.root.observable.trigger("switch", data)
diff --git a/src/packages/DummyApp/main.coffee b/src/packages/DummyApp/main.coffee
index d7ebec8..f1bac69 100644
--- a/src/packages/DummyApp/main.coffee
+++ b/src/packages/DummyApp/main.coffee
@@ -66,6 +66,8 @@ class DummyApp extends this.OS.GUI.BaseApplication
}
]
}
+ (@find "sw").set "onchange", (e) ->
+ console.log e, ((self.find "sw").get "swon")
tree.set "data",tdata
list = @find "mylist"
diff --git a/src/packages/DummyApp/scheme.html b/src/packages/DummyApp/scheme.html
index 1a5b7a2..aa6f574 100644
--- a/src/packages/DummyApp/scheme.html
+++ b/src/packages/DummyApp/scheme.html
@@ -10,7 +10,7 @@
-
+