SynchronizePageContextEntry.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. 'use strict';
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Watson Analytics (C) Copyright IBM Corp. 2018
  5. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. */
  7. define(['../../../filters/pagecontext/PageContextEntry'], function (PageContextEntry) {
  8. var SynchronizePageContextEntry = PageContextEntry.extend({
  9. init: function init() {
  10. SynchronizePageContextEntry.inherited('init', this, arguments);
  11. },
  12. setOriginalPageContextEntry: function setOriginalPageContextEntry(entry) {
  13. this.originalPageContextEntry = entry;
  14. //Update the id
  15. this.id = this.getKey();
  16. },
  17. getKey: function getKey() {
  18. return this._getOriginalValue() ? this.originalPageContextEntry.getKey() : SynchronizePageContextEntry.inherited('getKey', this, arguments);
  19. },
  20. getPageContextSpecItem: function getPageContextSpecItem() {
  21. return this._getOriginalValue() ? this.originalPageContextEntry.getPageContextSpecItem() : SynchronizePageContextEntry.inherited('getPageContextSpecItem', this, arguments);
  22. },
  23. _getOriginalValue: function _getOriginalValue() {
  24. return this.originalPageContextEntry && this.origin === 'filter';
  25. }
  26. });
  27. return SynchronizePageContextEntry;
  28. });
  29. //# sourceMappingURL=SynchronizePageContextEntry.js.map