projects
/
mkws-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0949829
)
Add mkws.objectWithParent function -- not yet used.
author
Mike Taylor
<mike@indexdata.com>
Fri, 28 Mar 2014 10:48:22 +0000
(10:48 +0000)
committer
Mike Taylor
<mike@indexdata.com>
Fri, 28 Mar 2014 10:48:22 +0000
(10:48 +0000)
src/mkws-core.js
patch
|
blob
|
history
diff --git
a/src/mkws-core.js
b/src/mkws-core.js
index
ba20871
..
893951c
100644
(file)
--- a/
src/mkws-core.js
+++ b/
src/mkws-core.js
@@
-102,6
+102,16
@@
mkws.log = function(string) {
};
+mkws.objectWithParent = function(parent) {
+ function thing() {} // Must be function so `prototype' works
+
+ thing.prototype = parent;
+ var res = new thing();
+ thing.prototype = null;
+ return res;
+};
+
+
mkws.registerWidgetType = function(name, fn) {
mkws.widgetType2function[name] = fn;
mkws.log("registered widget-type '" + name + "'");