Skip to content

Commit

Permalink
Adding remove button to environments dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
winton committed Nov 2, 2010
1 parent 7c0ed48 commit 0712c88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/a_b_front_end/view/dashboard.haml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
%label Domain name %label Domain name
.span-4.last .span-4.last
<input class='domains' name='domains[]' type='text' value='<%= (typeof(domain) != "undefined") ? domain : "" %>' /> <input class='domains' name='domains[]' type='text' value='<%= (typeof(domain) != "undefined") ? domain : "" %>' />
<img class="remove <% if (typeof(domain) == "undefined") { %>hide<% } %>" src="/image/remove.png">


%textarea.hide#tests_form_template %textarea.hide#tests_form_template
.dialog.span-7.last .dialog.span-7.last
Expand Down
6 changes: 4 additions & 2 deletions public/js/dashboard.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -71,13 +71,15 @@ window.Dashboard = function(sites) {
text_container.remove(); text_container.remove();


input_container.remove(); input_container.remove();
$('.variants', form).keyup(); $('.domains, .variants', form).keyup();


if (!control) if (!control)
$('.variants[value=]:last').focus(); $('.domains, .variants[value=]:last').focus();
} }


function domainKeyUp() { function domainKeyUp() {
if ($(this).val() != '')
$(this).next().removeClass('hide');
if ($('.domains[value=]').length < 1) { if ($('.domains[value=]').length < 1) {
$('.dialog .submit').before( $('.dialog .submit').before(
$('#envs_form_domain_template').tmpl() $('#envs_form_domain_template').tmpl()
Expand Down

0 comments on commit 0712c88

Please sign in to comment.