Skip to content

Commit

Permalink
[webui] Change how to close Kiwi dialogs
Browse files Browse the repository at this point in the history
To close a dialog of a new element, we check a class instead of the
title of the dialog.
  • Loading branch information
David Kang committed Aug 31, 2017
1 parent c65a136 commit d7888e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function closeDialog() {
}

fields.find(".ui-state-error").addClass('hidden');
dialog.removeClass('new_element');

hideOverlay(dialog);
}
Expand All @@ -87,7 +88,7 @@ function revertDialog() {
var fields = $(this).parents('.nested-fields');
var dialog = fields.find('.dialog');

if( /^Add/.test(dialog.find('.box-header').text())) {
if(dialog.hasClass('new_element')) {
hideOverlay(dialog);

fields.find('.remove_fields').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
%span.kiwi_actions.hidden
= link_to_remove_association sprite_tag("req-decline", title: 'remove'), f

.dialog.darkgrey_box{ style: "width: 500px; left: 45%;", class: "#{'hidden' if f.object.name.present?}" }
.dialog.darkgrey_box{ style: "width: 500px; left: 45%;", class: "#{'hidden' if f.object.name.present?} #{'new_element' if f.object.new_record?}"}
.box.box-shadow
%h2.box-header #{f.object.name.present? ? 'Edit' : 'Add'} package

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
%span.kiwi_actions.hidden
= link_to_remove_association(sprite_tag("req-decline", title: 'Delete Repository'), f)

.dialog.darkgrey_box{ style: "width: 500px; left: 45%;", class: "#{'hidden' if f.object.source_path.present?}" }
.dialog.darkgrey_box{ style: "width: 500px; left: 45%;", class: "#{'hidden' if f.object.source_path.present?} #{'new_element' if f.object.new_record?}" }
.box.box-shadow
%h2.box-header #{f.object.source_path.present? ? 'Edit' : 'Add'} repository

Expand Down

0 comments on commit d7888e9

Please sign in to comment.