##// END OF EJS Templates
bootstrapify delete dialog
MinRK -
Show More
@@ -1411,9 +1411,7 b' ul.icons-ul{list-style-type:none;text-indent:-0.7142857142857143em;margin-left:2'
1411 .list_container>div:last-child{border:none;}
1411 .list_container>div:last-child{border:none;}
1412 .list_item:hover .list_item{background-color:#ddd;}
1412 .list_item:hover .list_item{background-color:#ddd;}
1413 .list_container>div>span,.list_container>div>div{padding:8px;}
1413 .list_container>div>span,.list_container>div>div{padding:8px;}
1414 .cluster_list_item>a{}
1414 .list_item a{text-decoration:none;}
1415 .notebook_item a{text-decoration:none;}
1416 .action_col{}
1417 input.nbname_input{height:15px;}
1415 input.nbname_input{height:15px;}
1418 .highlight_text{color:blue;}
1416 .highlight_text{color:blue;}
1419 #project_name>.breadcrumb{padding:0px;margin-bottom:0px;background-color:transparent;font-weight:bold;}
1417 #project_name>.breadcrumb{padding:0px;margin-bottom:0px;background-color:transparent;font-weight:bold;}
@@ -213,7 +213,7 b' var IPython = (function (IPython) {'
213 NotebookList.prototype.add_delete_button = function (item) {
213 NotebookList.prototype.add_delete_button = function (item) {
214 var new_buttons = $('<span/>').addClass("btn-group pull-right");
214 var new_buttons = $('<span/>').addClass("btn-group pull-right");
215 var notebooklist = this;
215 var notebooklist = this;
216 var delete_button = $("<button/>").text("Delete").addClass("btn btn-mini").
216 var delete_button = $("<button/>").text("Delete").addClass("btn btn-mini btn-danger").
217 click(function (e) {
217 click(function (e) {
218 // $(this) is the button that was clicked.
218 // $(this) is the button that was clicked.
219 var that = $(this);
219 var that = $(this);
@@ -222,31 +222,28 b' var IPython = (function (IPython) {'
222 var parent_item = that.parents('div.list_item');
222 var parent_item = that.parents('div.list_item');
223 var nbname = parent_item.data('nbname');
223 var nbname = parent_item.data('nbname');
224 var notebook_id = parent_item.data('notebook_id');
224 var notebook_id = parent_item.data('notebook_id');
225 var dialog = $('<div/>');
225 var message = 'Are you sure you want to permanently delete the notebook: ' + nbname + '?';
226 dialog.html('Are you sure you want to permanently delete the notebook: ' + nbname + '?');
226 IPython.dialog.modal({
227 parent_item.append(dialog);
227 title : "Delete notebook",
228 dialog.dialog({
228 body : message,
229 resizable: false,
230 modal: true,
231 title: "Delete notebook",
232 buttons : {
229 buttons : {
233 "Delete": function () {
230 Delete : {
234 var settings = {
231 class: "btn-danger",
235 processData : false,
232 click: function() {
236 cache : false,
233 var settings = {
237 type : "DELETE",
234 processData : false,
238 dataType : "json",
235 cache : false,
239 success : function (data, status, xhr) {
236 type : "DELETE",
240 parent_item.remove();
237 dataType : "json",
241 }
238 success : function (data, status, xhr) {
242 };
239 parent_item.remove();
243 var url = notebooklist.baseProjectUrl() + 'notebooks/' + notebook_id;
240 }
244 $.ajax(url, settings);
241 };
245 $(this).dialog('close');
242 var url = notebooklist.baseProjectUrl() + 'notebooks/' + notebook_id;
243 $.ajax(url, settings);
244 }
246 },
245 },
247 "Cancel": function () {
246 Cancel : {}
248 $(this).dialog('close');
249 }
250 }
247 }
251 });
248 });
252 return false;
249 return false;
@@ -60,11 +60,7 b''
60 }
60 }
61
61
62
62
63 .cluster_list_item > a {
63 .list_item a {
64 /* color: @textColor !important;*/
65 }
66
67 .notebook_item a {
68 text-decoration: none;
64 text-decoration: none;
69 }
65 }
70
66
@@ -78,7 +74,6 b''
78 }
74 }
79
75
80 .action_col {
76 .action_col {
81 /* text-align: right;*/
82 }
77 }
83
78
84 input.nbname_input {
79 input.nbname_input {
@@ -85,6 +85,7 b' data-read-only={{read_only}}'
85
85
86 {% block script %}
86 {% block script %}
87 {{super()}}
87 {{super()}}
88 <script src="{{static_url("base/js/dialog.js") }}" type="text/javascript" charset="utf-8"></script>
88 <script src="{{static_url("tree/js/notebooklist.js") }}" type="text/javascript" charset="utf-8"></script>
89 <script src="{{static_url("tree/js/notebooklist.js") }}" type="text/javascript" charset="utf-8"></script>
89 <script src="{{static_url("tree/js/clusterlist.js") }}" type="text/javascript" charset="utf-8"></script>
90 <script src="{{static_url("tree/js/clusterlist.js") }}" type="text/javascript" charset="utf-8"></script>
90 <script src="{{static_url("tree/js/main.js") }}" type="text/javascript" charset="utf-8"></script>
91 <script src="{{static_url("tree/js/main.js") }}" type="text/javascript" charset="utf-8"></script>
General Comments 0
You need to be logged in to leave comments. Login now