Showing
4 changed files
with
158 additions
and
131 deletions
@@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
33 | } | 33 | } |
34 | header.append($("<h4>").addClass("modal-title").html(opt.title)); | 34 | header.append($("<h4>").addClass("modal-title").html(opt.title)); |
35 | var body = $("<div>").addClass("modal-body").css({ | 35 | var body = $("<div>").addClass("modal-body").css({ |
36 | - width : "100%", | 36 | + width : "100%", |
37 | overflow : "auto" | 37 | overflow : "auto" |
38 | }); | 38 | }); |
39 | if (opt.content !== undefined) { | 39 | if (opt.content !== undefined) { |
@@ -74,7 +74,14 @@ | @@ -74,7 +74,14 @@ | ||
74 | } | 74 | } |
75 | var dialogDiv = $("<div>").addClass("modal-dialog").css(opt.style).addClass(opt.size ? opt.size : "").attr("role", "document").appendTo(self); | 75 | var dialogDiv = $("<div>").addClass("modal-dialog").css(opt.style).addClass(opt.size ? opt.size : "").attr("role", "document").appendTo(self); |
76 | var contentDiv = $("<div>").addClass("modal-content").append(header).append(body).append(footer).appendTo(dialogDiv); | 76 | var contentDiv = $("<div>").addClass("modal-content").append(header).append(body).append(footer).appendTo(dialogDiv); |
77 | - | 77 | + if (opt.height) { |
78 | + body.css("height", opt.height); | ||
79 | + } | ||
80 | + if (opt.width) { | ||
81 | + contentDiv.css("width", opt.width); | ||
82 | + } | ||
83 | + | ||
84 | + | ||
78 | self.on("show.bs.modal", function(e) { | 85 | self.on("show.bs.modal", function(e) { |
79 | if (opt.onBeforeShow) { | 86 | if (opt.onBeforeShow) { |
80 | opt.onBeforeShow.call(self); | 87 | opt.onBeforeShow.call(self); |
@@ -101,10 +108,10 @@ | @@ -101,10 +108,10 @@ | ||
101 | keyboard : opt.keyboard, | 108 | keyboard : opt.keyboard, |
102 | show : opt.show | 109 | show : opt.show |
103 | })); | 110 | })); |
104 | - | 111 | + |
105 | }); | 112 | }); |
106 | }; | 113 | }; |
107 | - | 114 | + |
108 | /** | 115 | /** |
109 | * 销毁 | 116 | * 销毁 |
110 | */ | 117 | */ |
@@ -112,8 +119,8 @@ | @@ -112,8 +119,8 @@ | ||
112 | //$(jq).empty().removeClass("modal fade").removeAttr("role").removeAttr("aria-labelledby"); | 119 | //$(jq).empty().removeClass("modal fade").removeAttr("role").removeAttr("aria-labelledby"); |
113 | jq.remove(); | 120 | jq.remove(); |
114 | } | 121 | } |
115 | - | ||
116 | - | 122 | + |
123 | + | ||
117 | $.fn.dialog.methods = { | 124 | $.fn.dialog.methods = { |
118 | show : function() { | 125 | show : function() { |
119 | return this.each(function() { | 126 | return this.each(function() { |
@@ -154,7 +161,7 @@ | @@ -154,7 +161,7 @@ | ||
154 | }); | 161 | }); |
155 | } | 162 | } |
156 | }; | 163 | }; |
157 | - | 164 | + |
158 | $.fn.dialog.events = { | 165 | $.fn.dialog.events = { |
159 | onBeforeShow : function() {}, | 166 | onBeforeShow : function() {}, |
160 | onAfterShow : function() {}, | 167 | onAfterShow : function() {}, |
@@ -206,21 +206,23 @@ | @@ -206,21 +206,23 @@ | ||
206 | } | 206 | } |
207 | } | 207 | } |
208 | editBtn.click(function () { | 208 | editBtn.click(function () { |
209 | - var dialog = $("<div>").appendTo($("body")); | ||
210 | - dialog.dialog({ | ||
211 | - backdrop: "static", | ||
212 | - title: "异常详情", | ||
213 | - content: content, | ||
214 | - height: "60%", | ||
215 | - width: "50%", | ||
216 | - buttons: [{ | ||
217 | - text: "关闭", | ||
218 | - className: "btn-danger", | ||
219 | - onclick: function () { | ||
220 | - $(dialog).dialog("hide"); | ||
221 | - } | ||
222 | - }] | ||
223 | - }); | 209 | + if(content != ""){ |
210 | + var dialog = $("<div>").appendTo($("body")); | ||
211 | + dialog.dialog({ | ||
212 | + backdrop : "static", | ||
213 | + title : "异常详情", | ||
214 | + content : content, | ||
215 | + height : "700px", | ||
216 | + width : "1100px", | ||
217 | + buttons : [{ | ||
218 | + text : "关闭", | ||
219 | + className : "btn-danger", | ||
220 | + onclick : function() { | ||
221 | + $(dialog).dialog("hide"); | ||
222 | + } | ||
223 | + }] | ||
224 | + }); | ||
225 | + } | ||
224 | }); | 226 | }); |
225 | return div; | 227 | return div; |
226 | } | 228 | } |
@@ -296,21 +298,23 @@ | @@ -296,21 +298,23 @@ | ||
296 | } | 298 | } |
297 | } | 299 | } |
298 | editBtn.click(function () { | 300 | editBtn.click(function () { |
299 | - var dialog = $("<div>").appendTo($("body")); | ||
300 | - dialog.dialog({ | ||
301 | - backdrop: "static", | ||
302 | - title: "异常详情", | ||
303 | - content: content, | ||
304 | - height: "60%", | ||
305 | - width: "50%", | ||
306 | - buttons: [{ | ||
307 | - text: "关闭", | ||
308 | - className: "btn-danger", | ||
309 | - onclick: function () { | ||
310 | - $(dialog).dialog("hide"); | ||
311 | - } | ||
312 | - }] | ||
313 | - }); | 301 | + if(content != ""){ |
302 | + var dialog = $("<div>").appendTo($("body")); | ||
303 | + dialog.dialog({ | ||
304 | + backdrop : "static", | ||
305 | + title : "异常详情", | ||
306 | + content : content, | ||
307 | + height : "700px", | ||
308 | + width : "1100px", | ||
309 | + buttons : [{ | ||
310 | + text : "关闭", | ||
311 | + className : "btn-danger", | ||
312 | + onclick : function() { | ||
313 | + $(dialog).dialog("hide"); | ||
314 | + } | ||
315 | + }] | ||
316 | + }); | ||
317 | + } | ||
314 | }); | 318 | }); |
315 | return div; | 319 | return div; |
316 | } | 320 | } |
@@ -124,8 +124,8 @@ | @@ -124,8 +124,8 @@ | ||
124 | backdrop: "static", | 124 | backdrop: "static", |
125 | title: "异常详情", | 125 | title: "异常详情", |
126 | content: content, | 126 | content: content, |
127 | - height: "60%", | ||
128 | - width: "50%", | 127 | + height : "700px", |
128 | + width : "1100px", | ||
129 | buttons: [{ | 129 | buttons: [{ |
130 | text: "关闭", | 130 | text: "关闭", |
131 | className: "btn-danger", | 131 | className: "btn-danger", |
@@ -210,8 +210,8 @@ | @@ -210,8 +210,8 @@ | ||
210 | backdrop: "static", | 210 | backdrop: "static", |
211 | title: "异常详情", | 211 | title: "异常详情", |
212 | content: content, | 212 | content: content, |
213 | - height: "60%", | ||
214 | - width: "50%", | 213 | + height : "700px", |
214 | + width : "1100px", | ||
215 | buttons: [{ | 215 | buttons: [{ |
216 | text: "关闭", | 216 | text: "关闭", |
217 | className: "btn-danger", | 217 | className: "btn-danger", |
@@ -346,22 +346,25 @@ | @@ -346,22 +346,25 @@ | ||
346 | content= content +rowData.errorInfo[i]+"<br><br>"; | 346 | content= content +rowData.errorInfo[i]+"<br><br>"; |
347 | } | 347 | } |
348 | } | 348 | } |
349 | + | ||
349 | editBtn.click(function () { | 350 | editBtn.click(function () { |
350 | - var dialog = $("<div>").appendTo($("body")); | ||
351 | - dialog.dialog({ | ||
352 | - backdrop : "static", | ||
353 | - title : "异常详情", | ||
354 | - content : content, | ||
355 | - height : "80%", | ||
356 | - width : "60%", | ||
357 | - buttons : [{ | ||
358 | - text : "关闭", | ||
359 | - className : "btn-danger", | ||
360 | - onclick : function() { | ||
361 | - $(dialog).dialog("hide"); | ||
362 | - } | ||
363 | - }] | ||
364 | - }); | 351 | + if(content != ""){ |
352 | + var dialog = $("<div>").appendTo($("body")); | ||
353 | + dialog.dialog({ | ||
354 | + backdrop : "static", | ||
355 | + title : "异常详情", | ||
356 | + content : content, | ||
357 | + height : "700px", | ||
358 | + width : "1100px", | ||
359 | + buttons : [{ | ||
360 | + text : "关闭", | ||
361 | + className : "btn-danger", | ||
362 | + onclick : function() { | ||
363 | + $(dialog).dialog("hide"); | ||
364 | + } | ||
365 | + }] | ||
366 | + }); | ||
367 | + } | ||
365 | }); | 368 | }); |
366 | return div; | 369 | return div; |
367 | } | 370 | } |
@@ -382,21 +385,23 @@ | @@ -382,21 +385,23 @@ | ||
382 | } | 385 | } |
383 | } | 386 | } |
384 | editBtn.click(function () { | 387 | editBtn.click(function () { |
385 | - var dialog = $("<div>").appendTo($("body")); | ||
386 | - dialog.dialog({ | ||
387 | - backdrop : "static", | ||
388 | - title : "超时详情", | ||
389 | - content : content, | ||
390 | - height : "80%", | ||
391 | - width : "60%", | ||
392 | - buttons : [{ | ||
393 | - text : "关闭", | ||
394 | - className : "btn-danger", | ||
395 | - onclick : function() { | ||
396 | - $(dialog).dialog("hide"); | ||
397 | - } | ||
398 | - }] | ||
399 | - }); | 388 | + if(content != ""){ |
389 | + var dialog = $("<div>").appendTo($("body")); | ||
390 | + dialog.dialog({ | ||
391 | + backdrop : "static", | ||
392 | + title : "超时详情", | ||
393 | + content : content, | ||
394 | + height : "700px", | ||
395 | + width : "1100px", | ||
396 | + buttons : [{ | ||
397 | + text : "关闭", | ||
398 | + className : "btn-danger", | ||
399 | + onclick : function() { | ||
400 | + $(dialog).dialog("hide"); | ||
401 | + } | ||
402 | + }] | ||
403 | + }); | ||
404 | + } | ||
400 | }); | 405 | }); |
401 | return div; | 406 | return div; |
402 | } | 407 | } |
@@ -460,21 +465,23 @@ | @@ -460,21 +465,23 @@ | ||
460 | } | 465 | } |
461 | } | 466 | } |
462 | editBtn.click(function () { | 467 | editBtn.click(function () { |
463 | - var dialog = $("<div>").appendTo($("body")); | ||
464 | - dialog.dialog({ | ||
465 | - backdrop : "static", | ||
466 | - title : "异常详情", | ||
467 | - content : content, | ||
468 | - height : "80%", | ||
469 | - width : "60%", | ||
470 | - buttons : [{ | ||
471 | - text : "关闭", | ||
472 | - className : "btn-danger", | ||
473 | - onclick : function() { | ||
474 | - $(dialog).dialog("hide"); | ||
475 | - } | ||
476 | - }] | ||
477 | - }); | 468 | + if(content != ""){ |
469 | + var dialog = $("<div>").appendTo($("body")); | ||
470 | + dialog.dialog({ | ||
471 | + backdrop : "static", | ||
472 | + title : "异常详情", | ||
473 | + content : content, | ||
474 | + height : "700px", | ||
475 | + width : "1100px", | ||
476 | + buttons : [{ | ||
477 | + text : "关闭", | ||
478 | + className : "btn-danger", | ||
479 | + onclick : function() { | ||
480 | + $(dialog).dialog("hide"); | ||
481 | + } | ||
482 | + }] | ||
483 | + }); | ||
484 | + } | ||
478 | }); | 485 | }); |
479 | return div; | 486 | return div; |
480 | } | 487 | } |
@@ -495,21 +502,24 @@ | @@ -495,21 +502,24 @@ | ||
495 | } | 502 | } |
496 | } | 503 | } |
497 | editBtn.click(function () { | 504 | editBtn.click(function () { |
498 | - var dialog = $("<div>").appendTo($("body")); | ||
499 | - dialog.dialog({ | ||
500 | - backdrop : "static", | ||
501 | - title : "超时详情", | ||
502 | - content : content, | ||
503 | - height : "80%", | ||
504 | - width : "60%", | ||
505 | - buttons : [{ | ||
506 | - text : "关闭", | ||
507 | - className : "btn-danger", | ||
508 | - onclick : function() { | ||
509 | - $(dialog).dialog("hide"); | ||
510 | - } | ||
511 | - }] | ||
512 | - }); | 505 | + if(content != ""){ |
506 | + var dialog = $("<div>").appendTo($("body")); | ||
507 | + dialog.dialog({ | ||
508 | + backdrop : "static", | ||
509 | + title : "超时详情", | ||
510 | + content : content, | ||
511 | + height : "700px", | ||
512 | + width : "1100px", | ||
513 | + buttons : [{ | ||
514 | + text : "关闭", | ||
515 | + className : "btn-danger", | ||
516 | + onclick : function() { | ||
517 | + $(dialog).dialog("hide"); | ||
518 | + } | ||
519 | + }] | ||
520 | + }); | ||
521 | + } | ||
522 | + | ||
513 | }); | 523 | }); |
514 | return div; | 524 | return div; |
515 | } | 525 | } |
@@ -575,21 +585,24 @@ | @@ -575,21 +585,24 @@ | ||
575 | } | 585 | } |
576 | } | 586 | } |
577 | editBtn.click(function () { | 587 | editBtn.click(function () { |
578 | - var dialog = $("<div>").appendTo($("body")); | ||
579 | - dialog.dialog({ | ||
580 | - backdrop : "static", | ||
581 | - title : "异常详情", | ||
582 | - content : content, | ||
583 | - height : "80%", | ||
584 | - width : "60%", | ||
585 | - buttons : [{ | ||
586 | - text : "关闭", | ||
587 | - className : "btn-danger", | ||
588 | - onclick : function() { | ||
589 | - $(dialog).dialog("hide"); | ||
590 | - } | ||
591 | - }] | ||
592 | - }); | 588 | + if(content != ""){ |
589 | + var dialog = $("<div>").appendTo($("body")); | ||
590 | + dialog.dialog({ | ||
591 | + backdrop : "static", | ||
592 | + title : "异常详情", | ||
593 | + content : content, | ||
594 | + height : "700px", | ||
595 | + width : "1100px", | ||
596 | + buttons : [{ | ||
597 | + text : "关闭", | ||
598 | + className : "btn-danger", | ||
599 | + onclick : function() { | ||
600 | + $(dialog).dialog("hide"); | ||
601 | + } | ||
602 | + }] | ||
603 | + }); | ||
604 | + } | ||
605 | + | ||
593 | }); | 606 | }); |
594 | return div; | 607 | return div; |
595 | } | 608 | } |
@@ -610,21 +623,24 @@ | @@ -610,21 +623,24 @@ | ||
610 | } | 623 | } |
611 | } | 624 | } |
612 | editBtn.click(function () { | 625 | editBtn.click(function () { |
613 | - var dialog = $("<div>").appendTo($("body")); | ||
614 | - dialog.dialog({ | ||
615 | - backdrop : "static", | ||
616 | - title : "超时详情", | ||
617 | - content : content, | ||
618 | - height : "80%", | ||
619 | - width : "60%", | ||
620 | - buttons : [{ | ||
621 | - text : "关闭", | ||
622 | - className : "btn-danger", | ||
623 | - onclick : function() { | ||
624 | - $(dialog).dialog("hide"); | ||
625 | - } | ||
626 | - }] | ||
627 | - }); | 626 | + if(content != ""){ |
627 | + var dialog = $("<div>").appendTo($("body")); | ||
628 | + dialog.dialog({ | ||
629 | + backdrop : "static", | ||
630 | + title : "超时详情", | ||
631 | + content : content, | ||
632 | + height : "700px", | ||
633 | + width : "1100px", | ||
634 | + buttons : [{ | ||
635 | + text : "关闭", | ||
636 | + className : "btn-danger", | ||
637 | + onclick : function() { | ||
638 | + $(dialog).dialog("hide"); | ||
639 | + } | ||
640 | + }] | ||
641 | + }); | ||
642 | + } | ||
643 | + | ||
628 | }); | 644 | }); |
629 | return div; | 645 | return div; |
630 | } | 646 | } |
-
Please register or login to post a comment