|
Lines 338-343
define([
Link Here
|
| 338 |
|
338 |
|
| 339 |
// register onClose events |
339 |
// register onClose events |
| 340 |
this.on('close', lang.hitch(this, 'onCloseTab')); |
340 |
this.on('close', lang.hitch(this, 'onCloseTab')); |
|
|
341 |
|
| 342 |
// watch the state of the currently focused page |
| 343 |
this._loadUCRVariables().then(lang.hitch(this, function() { |
| 344 |
this.watch('selectedChildWidget', lang.hitch(this, '_updateModuleState')); |
| 345 |
})); |
| 346 |
}, |
| 347 |
|
| 348 |
_updateModuleState: function() { |
| 349 |
tools.defer(lang.hitch(this, function() { |
| 350 |
this.set('moduleState', this.get('moduleState')); |
| 351 |
}), 0); |
| 352 |
}, |
| 353 |
|
| 354 |
_setModuleStateAttr: function(_state) { |
| 355 |
var currentState = this.get('moduleState'); |
| 356 |
if (this._created && _state == this.moduleState || currentState == _state) { |
| 357 |
this._set('moduleState', _state); |
| 358 |
return; |
| 359 |
} |
| 360 |
var state = _state.split(':'); |
| 361 |
if (!state.length || (state.length == 1 && state[0] == '')) { |
| 362 |
if (this._searchPage) { |
| 363 |
this.selectChild(this._searchPage); |
| 364 |
} |
| 365 |
} |
| 366 |
else { |
| 367 |
var objType = state.shift(); |
| 368 |
var ldapName = state.length > 1 ? state : state[0]; |
| 369 |
this._loadUCRVariables().then(lang.hitch(this, function() { |
| 370 |
this.createDetailPage(objType, ldapName); |
| 371 |
})); |
| 372 |
} |
| 373 |
this._set('moduleState', _state); |
| 374 |
}, |
| 375 |
|
| 376 |
_getModuleStateAttr: function() { |
| 377 |
var state = []; |
| 378 |
if (this.selectedChildWidget && this.selectedChildWidget == this._detailPage) { |
| 379 |
var objectType = this._detailPage.objectType; |
| 380 |
var ldapName = this._detailPage.ldapName; |
| 381 |
state = [objectType]; |
| 382 |
if (ldapName && !(ldapName instanceof Array)) { |
| 383 |
state.push(ldapName); |
| 384 |
} |
| 385 |
} |
| 386 |
return state.join(':'); |
| 387 |
|
| 341 |
}, |
388 |
}, |
| 342 |
|
389 |
|
| 343 |
_ldapDN2TreePath: function( ldapDN ) { |
390 |
_ldapDN2TreePath: function( ldapDN ) { |
|
Lines 1586-1595
define([
Link Here
|
| 1586 |
} else { |
1633 |
} else { |
| 1587 |
this.selectChild(this._detailPage); |
1634 |
this.selectChild(this._detailPage); |
| 1588 |
} |
1635 |
} |
| 1589 |
this._detailPage.ready().then(function() { |
1636 |
this._detailPage.ready().then(lang.hitch(this, '_updateModuleState'), |
| 1590 |
}, lang.hitch(this, function() { |
1637 |
lang.hitch(this, function() { |
| 1591 |
this.closeDetailPage(); |
1638 |
this.closeDetailPage(); |
| 1592 |
})); |
1639 |
})); |
|
|
1640 |
|
| 1593 |
}, |
1641 |
}, |
| 1594 |
|
1642 |
|
| 1595 |
closeDetailPage: function() { |
1643 |
closeDetailPage: function() { |