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