New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change type of binding to allow changes to mergetabs during runtime #3508
Change type of binding to allow changes to mergetabs during runtime #3508
Conversation
@@ -90,7 +90,7 @@ gmf.displayquerygridComponent = { | |||
'removeEmptyColumnsFn': '&?gmfDisplayquerygridRemoveemptycolumns', | |||
'maxResultsFn': '&?gmfDisplayquerygridMaxresults', | |||
'maxRecenterZoomFn': '&?gmfDisplayquerygridMaxrecenterzoom', | |||
'mergeTabsFn': '&?gmfDisplayquerygridMergetabs' | |||
'mergeTabs': '=?gmfDisplayquerygridMergetabs' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<
is better than =
in this case. Because the change can only be from the main controller to this controller, never in the other way. So that's useless to watch the change in this controller.
@@ -274,7 +274,7 @@ gmf.DisplayquerygridController = function($injector, $scope, ngeoQueryResult, ng | |||
gmf.DisplayquerygridController.prototype.$onInit = function() { | |||
this.removeEmptyColumns_ = this['removeEmptyColumnsFn'] ? this['removeEmptyColumnsFn']() === true : false; | |||
this.maxRecenterZoom = this['maxRecenterZoomFn'] ? this['maxRecenterZoomFn']() : undefined; | |||
this.mergeTabs_ = this['mergeTabsFn'] ? this['mergeTabsFn']() : {}; | |||
this.mergeTabs_ = this['mergeTabs'] ? this['mergeTabs'] : {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this line and change the line 217 from:
/**
* @type {!gmfx.GridMergeTabs}
* @private
*/
this.mergeTabs_ = {};
to
/**
* @type {!gmfx.GridMergeTabs}
*/
this.mergeTabs = {};
Then, adapt all this.mergeTabs_
to this.mergeTabs
;
@@ -274,7 +273,7 @@ gmf.DisplayquerygridController = function($injector, $scope, ngeoQueryResult, ng | |||
gmf.DisplayquerygridController.prototype.$onInit = function() { | |||
this.removeEmptyColumns_ = this['removeEmptyColumnsFn'] ? this['removeEmptyColumnsFn']() === true : false; | |||
this.maxRecenterZoom = this['maxRecenterZoomFn'] ? this['maxRecenterZoomFn']() : undefined; | |||
this.mergeTabs_ = this['mergeTabs'] ? this['mergeTabs'] : {}; | |||
this.mergeTabs = this['mergeTabs'] ? this['mergeTabs'] : {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now you can completely remove this line. If nothing set the property, it will be the property declared in the constructor (so {}
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true
0a921c7
to
5e32ae1
Compare
see: GEO-977
Tested with desktop_alt. Changes to the bound object during runtime will be reflected in a new search.
This should not break existing code as long the feature is used like in the desktop_alt.