From 104db56b489305906cc4fb9af1a8ae4a3cbc1cb4 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 27 May 2016 23:04:15 +0300 Subject: [PATCH] another fix... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/core.js | 3 ++- ui (gen4)/lib/object.js | 6 ++++-- ui (gen4)/lib/widget/browse.js | 31 ++++++------------------------- 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/ui (gen4)/features/core.js b/ui (gen4)/features/core.js index dbbce014..ecb4bd1e 100755 --- a/ui (gen4)/features/core.js +++ b/ui (gen4)/features/core.js @@ -61,7 +61,8 @@ function(attr, states, a, b){ // Root ImageGrid.viewer object constructor... // var ImageGrid = -module.ImageGrid = object.makeConstructor('ImageGrid', actions.MetaActions) +module.ImageGrid = + object.makeConstructor('ImageGrid', Object.create(actions.MetaActions)) // Root ImageGrid feature set.... var ImageGridFeatures = diff --git a/ui (gen4)/lib/object.js b/ui (gen4)/lib/object.js index 148a012f..a812108f 100755 --- a/ui (gen4)/lib/object.js +++ b/ui (gen4)/lib/object.js @@ -104,6 +104,10 @@ define(function(require){ var module = {} // - easy refactoring without touching the client code // // +// NOTE: this sets the proto's .constructor attribute, this rendering it +// not reusable, to use the same prototype for multiple objects clone +// it via. Object.create(..) or copy it... +// // XXX might be a good idea to be able to make an instance without // initializing it... // ...mainly for inheritance. @@ -115,8 +119,6 @@ function makeConstructor(name, a, b){ var proto = b == null ? a : b var cls_proto = b == null ? b : a - proto = Object.create(proto) - var _constructor = function Constructor(){ /* // XXX BUG: if the constructor is called from it's instance this will diff --git a/ui (gen4)/lib/widget/browse.js b/ui (gen4)/lib/widget/browse.js index d164d88d..c7570f7a 100755 --- a/ui (gen4)/lib/widget/browse.js +++ b/ui (gen4)/lib/widget/browse.js @@ -2195,25 +2195,6 @@ var BrowserPrototype = { } -/* -// nw.js copy/paste handling... -// -// XXX not sure if we actually need these... -if(NW){ - // override copy... - BrowserPrototype.keyboard.General.C = { - ctrl: 'copy!', - } - BrowserPrototype.keyboard.General.X = 'C' - - // override paste... - BrowserPrototype.keyboard.General.V = { - ctrl: 'paste!', - } -} -*/ - - var Browser = module.Browser = object.makeConstructor('Browser', @@ -2228,7 +2209,7 @@ Browser.prototype.__proto__ = widget.Widget.prototype /*********************************************************************/ -var ListerPrototype = Object.create(BrowserPrototype) +var ListerPrototype = Object.create(Browser.prototype) ListerPrototype.options = { pathPrefix: '', fullPathEdit: false, @@ -2244,7 +2225,7 @@ ListerPrototype.options = { // ...inheriting might pose problems with deleting values reverting // them to default instead of nulling them and mutable options might // get overwritten... -ListerPrototype.options.__proto__ = BrowserPrototype.options +ListerPrototype.options.__proto__ = Browser.prototype.options var Lister = module.Lister = @@ -2287,7 +2268,7 @@ module.makeLister = function(elem, lister, options){ // disable this feature set it to false|null. // // NOTE: this essentially a different default configuration of Browser... -var ListPrototype = Object.create(BrowserPrototype) +var ListPrototype = Object.create(Browser.prototype) ListPrototype.options = { pathPrefix: '', @@ -2354,7 +2335,7 @@ ListPrototype.options = { // ...inheriting might pose problems with deleting values reverting // them to default instead of nulling them and mutable options might // get overwritten... -ListPrototype.options.__proto__ = BrowserPrototype.options +ListPrototype.options.__proto__ = Browser.prototype.options var List = module.List = @@ -2463,7 +2444,7 @@ module.makeList = makeBrowserMaker(List) // NOTE: currently only trailing '*' are supported. // // XXX add support for '*' and '**' glob patterns... -var PathListPrototype = Object.create(BrowserPrototype) +var PathListPrototype = Object.create(Browser.prototype) PathListPrototype.options = { fullPathEdit: true, @@ -2597,7 +2578,7 @@ PathListPrototype.options = { // ...inheriting might pose problems with deleting values reverting // them to default instead of nulling them and mutable options might // get overwritten... -PathListPrototype.options.__proto__ = BrowserPrototype.options +PathListPrototype.options.__proto__ = Browser.prototype.options var PathList = module.PathList =