Merge lp:~methanal-developers/methanal/dependency-styling into lp:methanal

Proposed by Jonathan Jacobs
Status: Merged
Approved by: Tristan Seligmann
Approved revision: 140
Merged at revision: 139
Proposed branch: lp:~methanal-developers/methanal/dependency-styling
Merge into: lp:methanal
Diff against target: 114 lines (+48/-10)
3 files modified
methanal/js/Methanal/View.js (+31/-10)
methanal/static/styles/methanal-ie.css (+4/-0)
methanal/static/styles/methanal.css (+13/-0)
To merge this branch: bzr merge lp:~methanal-developers/methanal/dependency-styling
Reviewer Review Type Date Requested Status
Tristan Seligmann Approve
Review via email: mp+29296@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/View.js'
--- methanal/js/Methanal/View.js 2010-03-09 08:57:31 +0000
+++ methanal/js/Methanal/View.js 2010-07-06 14:35:37 +0000
@@ -421,7 +421,6 @@
421 for (var name in self._depCache._inputToHandlers) {421 for (var name in self._depCache._inputToHandlers) {
422 var node = self.getControl(name).widgetParent.node;422 var node = self.getControl(name).widgetParent.node;
423 Methanal.Util.addElementClass(node, 'dependancy-parent');423 Methanal.Util.addElementClass(node, 'dependancy-parent');
424 node.title = 'Other fields depend on this field';
425 }424 }
426 self.refresh();425 self.refresh();
427 },426 },
@@ -946,6 +945,29 @@
946945
947946
948/**947/**
948 * Set a widget as active.
949 *
950 * The widget's visibility is determined by whether it is active or not,
951 * inactive widgets are not visible and their values are not used in form
952 * submission.
953 *
954 * @type active: C{boolean}
955 */
956Methanal.View._setActive = function _setActive(widget, active) {
957 widget.active = active;
958 if (active) {
959 Methanal.Util.removeElementClass(widget.node, 'hidden');
960 } else {
961 Methanal.Util.addElementClass(widget.node, 'hidden');
962 }
963 if (widget.widgetParent.checkActive) {
964 widget.widgetParent.checkActive();
965 }
966};
967
968
969
970/**
949 * A generic container for form inputs.971 * A generic container for form inputs.
950 */972 */
951Nevow.Athena.Widget.subclass(Methanal.View, 'InputContainer').methods(973Nevow.Athena.Widget.subclass(Methanal.View, 'InputContainer').methods(
@@ -1010,12 +1032,7 @@
1010 * @type active: C{boolean}1032 * @type active: C{boolean}
1011 */1033 */
1012 function setActive(self, active) {1034 function setActive(self, active) {
1013 self.active = active;1035 Methanal.View._setActive(self, active);
1014 self.node.style.display = active ? 'block' : 'none';
1015 Methanal.Util.addElementClass(self.node, 'dependancy-child');
1016 if (self.widgetParent.checkActive) {
1017 self.widgetParent.checkActive();
1018 }
1019 },1036 },
10201037
10211038
@@ -1056,6 +1073,12 @@
1056 function clearError(self) {1073 function clearError(self) {
1057 Methanal.View.FormRow.upcall(self, 'clearError');1074 Methanal.View.FormRow.upcall(self, 'clearError');
1058 Methanal.Util.replaceNodeText(self._errorTextNode, '');1075 Methanal.Util.replaceNodeText(self._errorTextNode, '');
1076 },
1077
1078
1079 function setActive(self, active) {
1080 Methanal.View.FormRow.upcall(self, 'setActive', active);
1081 Methanal.Util.addElementClass(self.node, 'dependancy-child');
1059 });1082 });
10601083
10611084
@@ -1294,9 +1317,7 @@
1294 * @type active: C{boolean}1317 * @type active: C{boolean}
1295 */1318 */
1296 function setActive(self, active) {1319 function setActive(self, active) {
1297 self.active = active;1320 Methanal.View._setActive(self, active);
1298 self.node.style.display = active ? 'block' : 'none';
1299 self.widgetParent.checkActive();
1300 self.getForm().validate(self);1321 self.getForm().validate(self);
1301 },1322 },
13021323
13031324
=== added file 'methanal/static/images/icons/dependency_parent.gif'
1304Binary files methanal/static/images/icons/dependency_parent.gif 1970-01-01 00:00:00 +0000 and methanal/static/images/icons/dependency_parent.gif 2010-07-06 14:35:37 +0000 differ1325Binary files methanal/static/images/icons/dependency_parent.gif 1970-01-01 00:00:00 +0000 and methanal/static/images/icons/dependency_parent.gif 2010-07-06 14:35:37 +0000 differ
=== modified file 'methanal/static/styles/methanal-ie.css'
--- methanal/static/styles/methanal-ie.css 2010-03-14 01:23:56 +0000
+++ methanal/static/styles/methanal-ie.css 2010-07-06 14:35:37 +0000
@@ -67,3 +67,7 @@
67 margin-bottom: -0.5em;67 margin-bottom: -0.5em;
68 padding: 0.25em;68 padding: 0.25em;
69}69}
70
71.dependancy-parent {
72 background-position: 3px center;
73}
7074
=== modified file 'methanal/static/styles/methanal.css'
--- methanal/static/styles/methanal.css 2010-03-14 01:24:31 +0000
+++ methanal/static/styles/methanal.css 2010-07-06 14:35:37 +0000
@@ -557,3 +557,16 @@
557.hidden {557.hidden {
558 display: none !important;558 display: none !important;
559}559}
560
561.dependancy-parent {
562 border-left: 3px solid #6094a4;
563 margin-left: -3px;
564 background-image: url("/static/Methanal/images/icons/dependency_parent.gif");
565 background-repeat: no-repeat;
566 background-position: left center;
567}
568
569.dependancy-child {
570 border-left: 3px solid #9fc4cf;
571 margin-left: -3px;
572}

Subscribers

People subscribed via source and target branches