Merge lp:~methanal-developers/methanal/802284-printable-modal-dialog into lp:methanal

Proposed by Jonathan Jacobs
Status: Merged
Approved by: Tristan Seligmann
Approved revision: 177
Merged at revision: 174
Proposed branch: lp:~methanal-developers/methanal/802284-printable-modal-dialog
Merge into: lp:methanal
Diff against target: 109 lines (+59/-1)
3 files modified
methanal/js/Methanal/Widgets.js (+11/-1)
methanal/static/styles/methanal-ie.css (+12/-0)
methanal/static/styles/methanal.css (+36/-0)
To merge this branch: bzr merge lp:~methanal-developers/methanal/802284-printable-modal-dialog
Reviewer Review Type Date Requested Status
Tristan Seligmann Approve
Review via email: mp+65918@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tristan Seligmann (mithrandi) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'methanal/js/Methanal/Widgets.js'
--- methanal/js/Methanal/Widgets.js 2011-03-14 11:21:02 +0000
+++ methanal/js/Methanal/Widgets.js 2011-06-26 21:45:56 +0000
@@ -1465,6 +1465,11 @@
1465 var T = Methanal.Util.DOMBuilder(self.node.ownerDocument);1465 var T = Methanal.Util.DOMBuilder(self.node.ownerDocument);
1466 self._overlayNode = T('div', {'class': 'modal-dialog-overlay'});1466 self._overlayNode = T('div', {'class': 'modal-dialog-overlay'});
1467 self.node.parentNode.appendChild(self._overlayNode);1467 self.node.parentNode.appendChild(self._overlayNode);
1468
1469 Methanal.Util.addElementClass(
1470 self.node.ownerDocument.body, 'printing');
1471 Methanal.Util.addElementClass(
1472 self.node, 'print-target');
1468 },1473 },
14691474
14701475
@@ -1472,6 +1477,11 @@
1472 * Dismiss the dialog.1477 * Dismiss the dialog.
1473 */1478 */
1474 function close(self) {1479 function close(self) {
1480 Methanal.Util.removeElementClass(
1481 self.node.ownerDocument.body, 'printing');
1482 Methanal.Util.removeElementClass(
1483 self.node, 'print-target');
1484
1475 self.detach();1485 self.detach();
1476 self.node.parentNode.removeChild(self.node);1486 self.node.parentNode.removeChild(self.node);
1477 self._overlayNode.parentNode.removeChild(self._overlayNode);1487 self._overlayNode.parentNode.removeChild(self._overlayNode);
@@ -1491,7 +1501,7 @@
1491Methanal.Widgets.ModalDialog.fromWidgetInfo = function fromWidgetInfo(widgetParent, widgetInfo) {1501Methanal.Widgets.ModalDialog.fromWidgetInfo = function fromWidgetInfo(widgetParent, widgetInfo) {
1492 var d = widgetParent.addChildWidgetFromWidgetInfo(widgetInfo);1502 var d = widgetParent.addChildWidgetFromWidgetInfo(widgetInfo);
1493 return d.addCallback(function (widget) {1503 return d.addCallback(function (widget) {
1494 widgetParent.node.appendChild(widget.node);1504 widgetParent.node.ownerDocument.body.appendChild(widget.node);
1495 Methanal.Util.nodeInserted(widget);1505 Methanal.Util.nodeInserted(widget);
1496 return widget;1506 return widget;
1497 });1507 });
14981508
=== modified file 'methanal/static/styles/methanal-ie.css'
--- methanal/static/styles/methanal-ie.css 2010-12-17 09:18:55 +0000
+++ methanal/static/styles/methanal-ie.css 2011-06-26 21:45:56 +0000
@@ -54,3 +54,15 @@
54.dependancy-parent {54.dependancy-parent {
55 background-position: 3px center;55 background-position: 3px center;
56}56}
57
58@media print {
59 .print-target .modal-dialog-middle {
60 top: 0;
61 }
62
63 .print-target .modal-dialog-inner {
64 /* 100% clips on the edges. */
65 width: 99%;
66 border: none;
67 }
68}
5769
=== modified file 'methanal/static/styles/methanal.css'
--- methanal/static/styles/methanal.css 2011-03-16 12:58:08 +0000
+++ methanal/static/styles/methanal.css 2011-06-26 21:45:56 +0000
@@ -368,8 +368,10 @@
368 margin: 5% auto;368 margin: 5% auto;
369 background: white;369 background: white;
370 padding: 1em;370 padding: 1em;
371 border-radius: 4px;
371 -moz-border-radius: 4px;372 -moz-border-radius: 4px;
372 -webkit-border-radius: 4px;373 -webkit-border-radius: 4px;
374 box-shadow: 0 0 30px #333;
373 -moz-box-shadow: 0 0 30px #333;375 -moz-box-shadow: 0 0 30px #333;
374 -webkit-box-shadow: 0 0 30px #333;376 -webkit-box-shadow: 0 0 30px #333;
375}377}
@@ -566,3 +568,37 @@
566 margin: 0.5em;568 margin: 0.5em;
567 margin-top: 1em;569 margin-top: 1em;
568}570}
571
572@media print {
573 body.printing > * {
574 display: none;
575 }
576
577 body.printing .print-target {
578 display: block;
579 position: absolute:
580 left: 0;
581 top: 0;
582 font-size: 50%;
583 }
584
585 .print-target .modal-dialog-middle {
586 display: block;
587 }
588
589 .print-target .modal-dialog-inner {
590 display: block;
591 max-width: 100%;
592 margin: auto;
593 border-radius: 0;
594 -moz-border-radius: 0;
595 -webkit-border-radius: 0;
596 box-shadow: none;
597 -moz-box-shadow: none;
598 -webkit-box-shadow: none;
599 }
600
601 .print-target .no-print {
602 display: none;
603 }
604}

Subscribers

People subscribed via source and target branches

to all changes: