More cleaning up artifacts in modals on edit/copy/new for #143

pull/169/head
William Woodson 2016-02-22 05:57:03 -06:00
parent 553ead7d68
commit a2ee229848
5 changed files with 20 additions and 7 deletions

View File

@ -191,6 +191,9 @@ $(document).ready(function() {
}
}, this));
};
$('#modal').on('hidden.bs.modal', function(event) {
dismiss()
});
api.campaigns.get()
.success(function(cs) {
campaigns = cs

View File

@ -36,7 +36,8 @@ function dismiss() {
$("#modal\\.flashes").empty()
$("#name").val("")
$("#html_editor").val("")
$("#newLandingPageModal").modal('hide')
$("#url").val("")
$("#modal").modal('hide')
}
function deletePage(idx) {
@ -117,10 +118,10 @@ function load() {
pagesTable.row.add([
page.name,
moment(page.modified_date).format('MMMM Do YYYY, h:mm:ss a'),
"<div class='pull-right'><span data-toggle='modal' data-target='#newLandingPageModal'><button class='btn btn-primary' data-toggle='tooltip' data-placement='left' title='Edit Page' onclick='edit(" + i + ")'>\
"<div class='pull-right'><span data-toggle='modal' data-target='#modal'><button class='btn btn-primary' data-toggle='tooltip' data-placement='left' title='Edit Page' onclick='edit(" + i + ")'>\
<i class='fa fa-pencil'></i>\
</button></span>\
<span data-toggle='modal' data-target='#newLandingPageModal'><button class='btn btn-primary' data-toggle='tooltip' data-placement='left' title='Copy Page' onclick='copy(" + i + ")'>\
<span data-toggle='modal' data-target='#modal'><button class='btn btn-primary' data-toggle='tooltip' data-placement='left' title='Copy Page' onclick='copy(" + i + ")'>\
<i class='fa fa-copy'></i>\
</button></span>\
<button class='btn btn-danger' data-toggle='tooltip' data-placement='left' title='Delete Page' onclick='deletePage(" + i + ")'>\
@ -177,5 +178,8 @@ $(document).ready(function() {
}
}, this));
};
$('#modal').on('hidden.bs.modal', function(event) {
dismiss()
});
load()
})

View File

@ -203,5 +203,8 @@ $(document).ready(function() {
}
}, this));
};
$('#modal').on('hidden.bs.modal', function(event) {
dismiss()
});
load()
})

View File

@ -321,5 +321,8 @@ $(document).ready(function() {
}
}, this));
};
$('#modal').on('hidden.bs.modal', function(event) {
dismiss()
});
load()
})

View File

@ -32,7 +32,7 @@
</h1>
<div id="flashes" class="row"></div>
<div class="row">
<button type="button" class="btn btn-primary" onclick="edit(-1)" data-toggle="modal" data-target="#newLandingPageModal"><i class="fa fa-plus"></i> New Page</button>
<button type="button" class="btn btn-primary" onclick="edit(-1)" data-toggle="modal" data-target="#modal"><i class="fa fa-plus"></i> New Page</button>
</div>
&nbsp;
<div id="loading">
@ -58,13 +58,13 @@
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="newLandingPageModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<!-- New Template Modal -->
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="dismiss()"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="pageModalLabel">New Landing Page</h4>
<h4 class="modal-title" id="modalLabel">New Landing Page</h4>
</div>
<div class="modal-body">
<div class="row" id="modal.flashes"></div>
@ -94,7 +94,7 @@
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="importSiteModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal fade" id="importSiteModal" tabindex="-1" role="dialog" aria-labelledby="importSiteModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<!-- New Template Modal -->