mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-12-24 20:11:56 +00:00
minor tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
d35ddc4a41
commit
449d8ceb21
@ -670,6 +670,7 @@ module.MetaActions = {
|
|||||||
|
|
||||||
// Mixin a set of local actions into an object...
|
// Mixin a set of local actions into an object...
|
||||||
//
|
//
|
||||||
|
// XXX this will not work on non-actions...
|
||||||
mixinTo: function(to, all, descriptors, all_attr_types){
|
mixinTo: function(to, all, descriptors, all_attr_types){
|
||||||
return this.mixin.call(to, this, all, descriptors, all_attr_types)
|
return this.mixin.call(to, this, all, descriptors, all_attr_types)
|
||||||
},
|
},
|
||||||
@ -741,6 +742,11 @@ module.MetaActions = {
|
|||||||
mixoutFrom: function(to, all, descriptors, all_attr_types){
|
mixoutFrom: function(to, all, descriptors, all_attr_types){
|
||||||
return this.mixout.call(to, this, all, descriptors, all_attr_types)
|
return this.mixout.call(to, this, all, descriptors, all_attr_types)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// XXX is this correct???
|
||||||
|
clone: function(){
|
||||||
|
return Object.create(this)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -23,10 +23,11 @@ function makeConstructor(name, a, b){
|
|||||||
var cls_proto = b == null ? b : a
|
var cls_proto = b == null ? b : a
|
||||||
|
|
||||||
var _constructor = function Constructor(){
|
var _constructor = function Constructor(){
|
||||||
|
/*
|
||||||
// in case this is called as a function (without new)...
|
// in case this is called as a function (without new)...
|
||||||
if(this.constructor !== _constructor){
|
if(this.constructor !== _constructor){
|
||||||
// NOTE: the folowing does the job of the 'new' operator but
|
// NOTE: the following does the job of the 'new' operator but
|
||||||
// with one advantage, we can now pass arbitrarry args
|
// with one advantage, we can now pass arbitrary args
|
||||||
// in...
|
// in...
|
||||||
// This is equivalent to:
|
// This is equivalent to:
|
||||||
// return new _constructor(json)
|
// return new _constructor(json)
|
||||||
@ -39,6 +40,19 @@ function makeConstructor(name, a, b){
|
|||||||
} else {
|
} else {
|
||||||
var obj = this
|
var obj = this
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// NOTE: the following does the job of the 'new' operator but
|
||||||
|
// with one advantage, we can now pass arbitrary args
|
||||||
|
// in...
|
||||||
|
// This is equivalent to:
|
||||||
|
// return new _constructor(json)
|
||||||
|
var obj = {}
|
||||||
|
obj.__proto__ = _constructor.prototype
|
||||||
|
// XXX for some reason this does not resolve from .__proto__
|
||||||
|
obj.constructor = _constructor
|
||||||
|
//obj.__proto__.constructor = _constructor
|
||||||
|
|
||||||
|
|
||||||
// load initial state...
|
// load initial state...
|
||||||
if(obj.__init__ != null){
|
if(obj.__init__ != null){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user