summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-03-04 15:05:02 -0600
committerAdam Young <ayoung@redhat.com>2011-03-04 16:39:07 -0500
commit8b041cd1a359b0a3496c16abbc6a32c804084d83 (patch)
treea20de8ecb73b9472bd6ea397967163f390e0ace1
parentf4b8b369598f3c5678f65c923b84f28eabbec957 (diff)
downloadfreeipa-8b041cd1a359b0a3496c16abbc6a32c804084d83.zip
freeipa-8b041cd1a359b0a3496c16abbc6a32c804084d83.tar.gz
freeipa-8b041cd1a359b0a3496c16abbc6a32c804084d83.tar.xz
Fixed memory leak caused by is_dirty dialogs.
Ticket 1054
-rw-r--r--install/ui/associate.js27
-rw-r--r--install/ui/ipa.js26
2 files changed, 26 insertions, 27 deletions
diff --git a/install/ui/associate.js b/install/ui/associate.js
index db3a9cd..e8cb4d0 100644
--- a/install/ui/associate.js
+++ b/install/ui/associate.js
@@ -351,24 +351,21 @@ IPA.association_table_widget = function (spec) {
that.table_setup(container);
- var dialog = $('<div/>', {
- html: IPA.messages.dialogs.dirty_message
- }).appendTo(container);
-
- var buttons = {};
+ var dialog = IPA.dialog({
+ title: IPA.messages.dialogs.dirty_title,
+ width: '20em'
+ });
- buttons[IPA.messages.buttons.ok] = function() {
- dialog.dialog('close');
+ dialog.create = function() {
+ dialog.container.append(IPA.messages.dialogs.dirty_message);
};
- dialog.dialog({
- autoOpen: false,
- title: IPA.messages.dialogs.dirty_title,
- modal: true,
- width: '20em',
- buttons: buttons
+ dialog.add_button(IPA.messages.buttons.ok, function() {
+ dialog.close();
});
+ dialog.init();
+
var entity = IPA.get_entity(that.entity_name);
var facet_name = IPA.current_facet(entity);
var facet = entity.get_facet(facet_name);
@@ -383,7 +380,7 @@ IPA.association_table_widget = function (spec) {
}
if (facet.is_dirty()) {
- dialog.dialog('open');
+ dialog.open(that.container);
} else {
that.show_remove_dialog();
}
@@ -402,7 +399,7 @@ IPA.association_table_widget = function (spec) {
}
if (facet.is_dirty()) {
- dialog.dialog('open');
+ dialog.open(that.container);
} else {
that.show_add_dialog();
}
diff --git a/install/ui/ipa.js b/install/ui/ipa.js
index ec15332..cbe009b 100644
--- a/install/ui/ipa.js
+++ b/install/ui/ipa.js
@@ -135,24 +135,26 @@ var IPA = ( function () {
if (IPA.current_entity){
var facet_name = IPA.current_facet(IPA.current_entity);
var facet = IPA.current_entity.facets_by_name[facet_name];
+
if (facet.is_dirty()){
- var message_box = $("<div/>",{
- html: IPA.messages.dialogs.dirty_message
- }).
- appendTo($("#navigation"));
- var buttons = {};
+ var dialog = IPA.dialog({
+ title: IPA.messages.dialogs.dirty_title,
+ width: '20em'
+ });
- buttons[IPA.messages.buttons.ok] = function() {
- $(this).dialog("close");
+ dialog.create = function() {
+ dialog.container.append(IPA.messages.dialogs.dirty_message);
};
- message_box.dialog({
- title: IPA.messages.dialogs.dirty_title,
- modal:true,
- width: '20em',
- buttons: buttons
+ dialog.add_button(IPA.messages.buttons.ok, function() {
+ dialog.close();
});
+
+ dialog.init();
+
+ dialog.open($('#navigation'));
+
return false;
}
}