Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed multi drawer behaviour

Change-Id: Ie6a8552cf4d78b08686e6be62020dc9daa54f5ac
Reviewed-on: http://review.northscale.com/3206
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Steve Yen <steve.yen@gmail.com>
  • Loading branch information...
commit 84b8ec4a60b5406c34ccd8ab354515b08794244f 1 parent cb0d4fa
Aliaksey Kandratsenka (aka Aliaksei Kandratsenka) alk authored steveyen committed
Showing with 12 additions and 16 deletions.
  1. +12 −16 deps/menelaus/priv/js/app-misc.js
28 deps/menelaus/priv/js/app-misc.js
View
@@ -380,21 +380,19 @@ var MultiDrawersWidget = mkClass({
if (!cell) {
var uriCell = new Cell(function (openedNames) {
- if (this.self.value || !_.include(openedNames, e[key]))
- return this.self.value;
-
+ if (!_.include(openedNames, e[key]))
+ return undefined;
return self.options.uriExtractor(e);
}, {openedNames: self.openedNames});
cell = new Cell(function (uri) {
- return future.get({url: uri}, function (childItem) {
- if (self.options.valueTransformer)
- childItem = self.options.valueTransformer(e, childItem);
- return childItem;
- });
+ return future.get({url: uri});
}, {uri: uriCell});
self.knownKeys[e[key]] = cell;
+ } else {
+ cell.keepValueDuringAsync = true;
+ cell.invalidate();
}
e[drawerCellName] = cell;
@@ -402,13 +400,6 @@ var MultiDrawersWidget = mkClass({
var oldE = oldElementsByName[e[key]];
var oldCell = oldE && oldE[drawerCellName];
- // use previous value if possible, but refresh it
- if (oldCell && oldCell.value) {
- cell.setValue(oldCell.value);
- cell.keepValueDuringAsync = true;
- cell.invalidate();
- }
-
self.elementsByName[e[key]] = e;
});
return elements;
@@ -456,7 +447,12 @@ var MultiDrawersWidget = mkClass({
throw new Error("MultiDrawersWidget: bad markup!");
}
- var s = renderCellTemplate(element[self.options.drawerCellName], [container, self.options.template]);
+ var s = renderCellTemplate(element[self.options.drawerCellName], [container, self.options.template],
+ function (value) {
+ if (!self.options.valueTransformer)
+ return value;
+ return self.options.valueTransformer(element, value);
+ });
subscriptions.push(s);
q.show();
Please sign in to comment.
Something went wrong with that request. Please try again.