From 1eb79c37bfb597ac51f85ab67f7f8e7354f72c59 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 8 Dec 2014 19:11:53 +0300 Subject: [PATCH] minor tweaks... Signed-off-by: Alex A. Naanou --- ui (gen4)/object.js | 1 + ui (gen4)/viewer.js | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ui (gen4)/object.js b/ui (gen4)/object.js index bcb19867..baaceb55 100755 --- a/ui (gen4)/object.js +++ b/ui (gen4)/object.js @@ -32,6 +32,7 @@ function makeConstructor(name, a, b){ obj.__proto__ = _constructor.prototype // XXX for some reason this does not resolve from .__proto__ obj.constructor = _constructor + //obj.__proto__.constructor = _constructor } else { var obj = this diff --git a/ui (gen4)/viewer.js b/ui (gen4)/viewer.js index 4f4a8e12..24c6dfa3 100755 --- a/ui (gen4)/viewer.js +++ b/ui (gen4)/viewer.js @@ -837,6 +837,12 @@ actions.Actions(Client, { this.ribbons.restoreTransitions() } }], + // NOTE: this will trigger .updateImage hooks... + refresh: ['A lighter version of reload', + function(gids){ + gids = gids || '*' + this.ribbons.updateImage(gids) + }], clear: [ function(){ this.ribbons.clear() }], @@ -866,12 +872,18 @@ actions.Actions(Client, { // This is called by .ribbons, the goal is to use it to hook into // image updating from features and extensions... // - // NOTE: not intended for calling manually. + // NOTE: not intended for calling manually, use .refresh(..) instead... // // XXX experimental... // ...need this to get triggered by .ribbons // at this point manually triggering this will not do anything... - updateImage: ['', function(gid, image){ }], + // XXX problem: need to either redesign this or distinguish from + // other actions as I keep calling it expecting results... + // NOTE: calling this.ribbons.updateImage(gid, image) from within + // this will result in infinite recursion... + // ...we need this to be triggered from .ribbons + // XXX hide from user action list... + updateImage: ['This will do nothing', function(gid, image){ }], // General UI stuff... @@ -1219,16 +1231,15 @@ actions.Actions(Client, { // generate the view... this.data = this.data.cropRibbons() - this.reload() } else { var data = this._full_data delete this._full_data // restore... this.data = data.mergeRibbonCrop(this.data) - - this.reload() } + + this.reload() }], })