1
0
Fork 0
Commit Graph

82 Commits (2c49156ba3e5229df6145df90a8cb46b58d3144c)

Author SHA1 Message Date
Mike Gerwitz e1c2194962 DomField will now consider that field element might have changed on DOM
This solves styling and DOM mutation issues.  For now.

* src/ui/field/DomField.js (queryElement, updateElement): Added
(_getElement): Extracted into queryElement and updated to re-query DOM each
time, returning last match if not found.
(applyStyle, revokeStyle): Defers style applied predicate to style itself
2016-04-04 15:35:43 -04:00
Mike Gerwitz 40505c3328 FieldStyler#isApplied added
Field stylers now determine whether they've been applied to the target field
on their own, which solves the problem of the system getting out of sync.

* src/ui/styler/ErrorFieldStyler.js (isApplied): Added
* src/ui/styler/FieldStyler.js (isApplied): Added
* src/ui/styler/NaFieldStyler.js (isApplied): Added
* test/ui/styler/NaFieldStylerTest.js: Test for #isApplied
2016-04-04 15:25:52 -04:00
Mike Gerwitz ae9f2a7cab NaFieldStyler remove subfields from DOM
This is necessarily primarily for a specific case: option elements in IE,
which cannot be styled. >:O

This implementation is not complete: we want to re-attach the field at the
same position it was at before it was detached.  This might not be
trivial---imagine if its sibling was also detached.

* src/ui/styler/NaFieldStyler.js (isSubField): Receive field instead of
element (to check parent)
(applyStyle, revokeStyle): Detach and re-attach field from/to DOM
respectively

* test/ui/styler/NaFieldStylerTest.js: Associated tests
2016-04-04 12:30:21 -04:00
Mike Gerwitz 782e4832af Cache DomField parent element
* src/ui/field/DomField.js (getParentElement):
Renamed from getParent.  Cache parent element in memory so that we have a
reference for re-attaching fields to the DOM.
(getParent): Public API addition; call getParentElement
2016-04-04 12:30:21 -04:00
Mike Gerwitz fa37850408 Proper NaFieldStyler sub-field hiding support
* src/ui/styler/NaFieldStyler.js (_isSubField): Added
(applyStyle, revokeStyle): Will not hide parents of sub-fields
2016-04-04 12:30:21 -04:00
Mike Gerwitz 064fcd00fd Abort TabbedGroupUi hide when deferred
* src/ui/group/TabbedGroupUi.js (doShowField, doHideField):
Return from method after setting deferred operation.  This previously
did not fail because jQuery didn't care if operations are not
performed on field matches.
2016-04-04 12:30:05 -04:00
Mike Gerwitz eb073f5db0 DomField#getParent proper nodeName comparison
* src/ui/field/DomFieldFactory (getParent): Convert parent nodeName to
uppercase before comparison (it might not always be)
2016-04-04 11:17:14 -04:00
Mike Gerwitz edbc45a79b DomField#getContainingRow handling of direct row reference
* src/ui/field/DomField.js (getContainingRow): Return self if DT or DD

Certain types of elements (e.g. statics) are compiled such that the direct
reference is the row itself.
2016-04-04 11:17:14 -04:00
Mike Gerwitz c204a12c19 Add NaFieldStyler
* src/ui/styler/NaFieldStyler.js: Added
* test/ui/styler/NaFieldStylerTest.js: Added
2016-04-04 11:17:12 -04:00
Mike Gerwitz 4cce3759db Rename method todo on DomContext#_dequeue
* src/ui/context/DomContext.js (_dequeue): Add todo
2016-04-02 00:30:42 -04:00
Mike Gerwitz d126f618ae Add FieldStyler docblocks
* src/ui/styler/FieldStyler.js (getId, applyStyle, revokeStyle,
addClass, removeClass): Docblocks added
2016-04-02 00:30:42 -04:00
Mike Gerwitz a3b16f33c9 Liberate ui/styler/
* src/ui/styler/ErrorFieldStyler.js: Added
* src/ui/styler/ErrorStyler.js: Added
* src/ui/styler/FieldStyler.js: Added
* src/ui/styler/SidebarErrorStyler.js: Added
* src/ui/styler/StepErrorStyler.js: Added
* src/ui/styler/Styler.js: Added
2016-04-02 00:30:42 -04:00
Mike Gerwitz 37c74eac48 ElementStyler.js (__construct): Decouple jQuery instance 2016-04-02 00:30:42 -04:00
Mike Gerwitz fea4e151cc Liberated archaic DOM element styler
* src/ui/ElementStyler.js: Added

* src/sort/MultiSort.js: Removed ElementStyler liberation todo
* src/ui/field/DomFieldFactory.js: Same
* src/ui/step/GeneralStepUi.js: Same
* src/ui/step/StepUiBuilder.js: Same

This existed when the framework was very long, and has managed to survive
numerous refactoring attempts; it used to be a small class abstracting
element styling, and it has had crap thrown into it ever since, partially
due to time constraints.  It needs to go away.
2016-04-02 00:30:11 -04:00
Mike Gerwitz 003d527307 Liberate context/
* ui/context/Context.js: Added
* ui/context/DomContext.js: Added
* ui/context/DynamicContext.js: Added
* ui/context/RootDomContext.js: Added
2016-04-01 16:03:52 -04:00
Mike Gerwitz 2fa20c9864 Group support for showing/hiding sub-fields
* src/ui/GroupUi.js (getFieldElements): New method
(showField, hideField): Use GroupUi#getFieldElements

* src/ui/group/TabbedGroupUi (showField, hideField):
Use GroupUi#getFieldElements
2016-03-30 14:16:27 -04:00
Arthur Domino 93bff03676 Do not collapse CollapseTableGroups when created. 2016-03-29 09:58:26 -04:00
Mike Gerwitz c56d6ac7b2 GeneralStepUi#_sortGroups: correct group sorting
The modified parent was not the parent of groups, so the group DOM operations failed.
2015-12-04 10:03:52 -05:00
Mike Gerwitz 1a3dd236f8 GeneralStepUi#_sortGroups: maintain DOM order after group sorting
This was affected by 4ce78ebd9e.
2015-12-03 08:27:59 -05:00
Mike Gerwitz a60bf6b52e Liberated Group and its various UIs
The `AccordionGroupUi` was not liberated, because it is my intent to
eliminate it---I did not agree with its needless addition to begin with.  If
we do end up keeping it, then it will be liberated as well.
2015-12-03 00:36:31 -05:00
Mike Gerwitz 3d9780c39e {=>General}StepUi; StepUi interface
This allows us to begin development (and testing) of StepUi subtypes without
having to worry about the convoluted crap that GeneralStepUi is doing.
Specifically, all the jQuery stuff needs to go.
2015-12-03 00:11:53 -05:00
Mike Gerwitz cc21298297 StepUi: Accept and return vanilla DOM content
This encapsulates the use of jQuery which will eventually be entirely
eliminated.
2015-12-03 00:11:53 -05:00
Mike Gerwitz 972856225b Extract StepUi#detach
You can't see where this is going, because there is other code that is not
yet part of Liza.  ...sorry.
2015-12-03 00:11:52 -05:00
Mike Gerwitz 4ce78ebd9e StepUiBuilder do not enclose groups in parent element
This allows the caller to handle how to group and render steps.  But we do
add another container to hold each of the groups.
2015-12-03 00:11:52 -05:00
Mike Gerwitz 44323a0b59 Liberated StepUiBuilder 2015-12-03 00:11:52 -05:00
Mike Gerwitz 9a1dd337eb Liberate {,ui/}field/ 2015-11-30 14:38:42 -05:00
Mike Gerwitz 1c4554dd0d Minor StepUi cleanup 2015-11-30 11:57:10 -05:00
Mike Gerwitz 215869e1ea Liberate StepUi
This has a lot of rough code in it, much of which I do not approve of.  But
it'll never be liberated if I make everything pristine beforehand!
2015-11-30 11:37:41 -05:00
Mike Gerwitz 6149649327 jQuery dependency injected into GroupUi 2015-05-01 14:20:13 -04:00
Mike Gerwitz 0fe2df4de3 License header added to GroupUi 2015-05-01 14:20:13 -04:00
Mike Gerwitz ab34cc89b0 GroupUi needs love (cleanup, testing, etc) 2015-05-01 14:20:11 -04:00
Mike Gerwitz 35e1494b9c Extract GroupUi from internal repository
Verbatim.
2015-05-01 11:10:49 -04:00