mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Use dojo/on instead of dojo/topic for facet-xxx events'
https://fedorahosted.org/freeipa/ticket/3236
This commit is contained in:
parent
c0007704e8
commit
cc92060e35
@ -71,11 +71,10 @@ define(['dojo/_base/declare',
|
|||||||
on(this.app_widget, 'logout-click', lang.hitch(this, this.on_logout));
|
on(this.app_widget, 'logout-click', lang.hitch(this, this.on_logout));
|
||||||
on(this.menu, 'selected', lang.hitch(this, this.on_menu_select));
|
on(this.menu, 'selected', lang.hitch(this, this.on_menu_select));
|
||||||
|
|
||||||
topic.subscribe('facet-show', lang.hitch(this, this.on_facet_show));
|
on(this.router, 'facet-show', lang.hitch(this, this.on_facet_show));
|
||||||
topic.subscribe('facet-change', lang.hitch(this, this.on_facet_change));
|
on(this.router, 'facet-change', lang.hitch(this, this.on_facet_change));
|
||||||
topic.subscribe('facet-change-canceled', lang.hitch(this, this.on_facet_canceled));
|
on(this.router, 'facet-change-canceled', lang.hitch(this, this.on_facet_canceled));
|
||||||
topic.subscribe('phase-error', lang.hitch(this, this.on_phase_error));
|
topic.subscribe('phase-error', lang.hitch(this, this.on_phase_error));
|
||||||
topic.subscribe('facet-state-change', lang.hitch(this, this.on_facet_state_changed));
|
|
||||||
|
|
||||||
this.app_widget.render();
|
this.app_widget.render();
|
||||||
},
|
},
|
||||||
@ -223,6 +222,7 @@ define(['dojo/_base/declare',
|
|||||||
|
|
||||||
if (!facet.container) {
|
if (!facet.container) {
|
||||||
facet.container_node = this.app_widget.content_node;
|
facet.container_node = this.app_widget.content_node;
|
||||||
|
on(facet, 'facet-state-change', lang.hitch(this, this.on_facet_state_changed));
|
||||||
}
|
}
|
||||||
if (this.current_facet) {
|
if (this.current_facet) {
|
||||||
this.current_facet.hide();
|
this.current_facet.hide();
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
define([
|
define([
|
||||||
'dojo/_base/declare',
|
'dojo/_base/declare',
|
||||||
'dojo/_base/lang',
|
'dojo/_base/lang',
|
||||||
'dojo/topic',
|
|
||||||
'dojo/dom-construct',
|
'dojo/dom-construct',
|
||||||
'dojo/on',
|
'dojo/on',
|
||||||
'dojo/Stateful',
|
'dojo/Stateful',
|
||||||
@ -35,7 +34,7 @@ define([
|
|||||||
'./dialog',
|
'./dialog',
|
||||||
'./field',
|
'./field',
|
||||||
'./widget'
|
'./widget'
|
||||||
], function(declare, lang, topic, construct, on, Stateful, Evented,
|
], function(declare, lang, construct, on, Stateful, Evented,
|
||||||
IPA, $, navigation) {
|
IPA, $, navigation) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -101,7 +100,7 @@ IPA.facet = function(spec, no_init) {
|
|||||||
spec.state = spec.state || {};
|
spec.state = spec.state || {};
|
||||||
$.extend(spec.state, { factory: IPA.state });
|
$.extend(spec.state, { factory: IPA.state });
|
||||||
|
|
||||||
var that = {};
|
var that = new Evented();
|
||||||
|
|
||||||
that.entity = IPA.get_entity(spec.entity);
|
that.entity = IPA.get_entity(spec.entity);
|
||||||
|
|
||||||
@ -321,7 +320,7 @@ IPA.facet = function(spec, no_init) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
that._notify_state_change = function(state) {
|
that._notify_state_change = function(state) {
|
||||||
topic.publish('facet-state-change', {
|
that.emit('facet-state-change', {
|
||||||
facet: that,
|
facet: that,
|
||||||
state: state
|
state: state
|
||||||
});
|
});
|
||||||
|
@ -19,16 +19,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
define(['dojo/_base/declare',
|
define(['dojo/_base/declare',
|
||||||
'dojo/router',
|
|
||||||
'dojo/_base/lang',
|
'dojo/_base/lang',
|
||||||
'dojo/_base/array',
|
'dojo/_base/array',
|
||||||
|
'dojo/Evented',
|
||||||
'dojo/io-query',
|
'dojo/io-query',
|
||||||
'dojo/topic',
|
'dojo/router',
|
||||||
'../entities',
|
'../entities',
|
||||||
'../facets',
|
'../facets',
|
||||||
'../ipa' //TODO: remove dependancy
|
'../ipa' //TODO: remove dependancy
|
||||||
],
|
],
|
||||||
function(declare, router, lang, array, ioquery, topic, entities, facets, IPA) {
|
function(declare, lang, array, Evented, ioquery, router, entities, facets, IPA) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class navigation
|
* Class navigation
|
||||||
@ -38,7 +38,7 @@ define(['dojo/_base/declare',
|
|||||||
* displayed facet. This change can be canceled in 'facet-change'
|
* displayed facet. This change can be canceled in 'facet-change'
|
||||||
* event handler.
|
* event handler.
|
||||||
*/
|
*/
|
||||||
var navigation = declare(null, {
|
var navigation = declare([Evented], {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds references to register route handlers.
|
* Holds references to register route handlers.
|
||||||
@ -212,9 +212,9 @@ define(['dojo/_base/declare',
|
|||||||
navigate_to_hash: function(hash, facet) {
|
navigate_to_hash: function(hash, facet) {
|
||||||
|
|
||||||
this.canceled = false;
|
this.canceled = false;
|
||||||
topic.publish('facet-change', { facet: facet, hash: hash });
|
this.emit('facet-change', { facet: facet, hash: hash });
|
||||||
if (this.canceled) {
|
if (this.canceled) {
|
||||||
topic.publish('facet-change-canceled', { facet: facet, hash : hash });
|
this.emit('facet-change-canceled', { facet: facet, hash : hash });
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.update_hash(hash, false);
|
this.update_hash(hash, false);
|
||||||
@ -288,7 +288,7 @@ define(['dojo/_base/declare',
|
|||||||
*/
|
*/
|
||||||
show_facet: function(facet) {
|
show_facet: function(facet) {
|
||||||
|
|
||||||
topic.publish('facet-show', {
|
this.emit('facet-show', {
|
||||||
facet: facet
|
facet: facet
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user