</div>
<div id="rightSide">
+<div id="successBox">
+</div>
<div id="errorBox">
</div>
</table>
</script>
+<script type="text/template" id="test-success-template">
+ <button id="close-success-box">Close Success Message</button>
+ <h3>Success!</h3>
+ <table class="test-success-table">
+ <tr><td>Code:</td><td><%= status %></td></tr>
+ <tr><td>Message:</td><td><%= statusText %></td></tr>
+ </table>
+</script>
+
<!-- Deployment -->
<script type="text/template" id="test-deployment-list-template">
TestApp.hideError = function(result) {
$("#errorBox").hide();
+ $("#successBox").hide();
+};
+
+TestApp.showSuccess = function(result) {
+ $("#successBox").show();
+ $("#successBox").html(_.template($("#test-success-template").html())(result));
+ $('#close-success-box').unbind().bind('click', function() {
+ $('#successBox').hide();
+ });
};
TestApp.showError = function(result) {
TestApp.showError(result);\r
},\r
\r
+ saveSuccess: function(model, result, xhr) {\r
+ TestApp.showSuccess({status: xhr.xhr.status, statusText: xhr.xhr.statusText});\r
+ },\r
+\r
submitClicked: function(e) {\r
TestApp.hideError();\r
e.preventDefault();\r
var data = Backbone.Syphon.serialize(this);\r
var thisView = this;\r
- this.model.save(data, {error: function(model, result, xhr) { thisView.saveError(model, result, xhr); }});\r
+ this.model.save(data, {error: function(model, result, xhr) { thisView.saveError(model, result, xhr); },\r
+ success: function(model, result, xhr) { thisView.saveSuccess(model, result, xhr); }});\r
this.dirty = false;\r
},\r
});
var listView = new listViewClass();
TestApp[region_name].show(listView);
- xos[collection_name].startPolling();
+ xos[collection_name].fetch(); //startPolling();
}
$('#close-detail-view').unbind().bind('click', function() {