extjs-rails 4.1.0.alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE +36 -0
- data/README.md +29 -0
- data/Rakefile +2 -0
- data/app/assets/javascripts/extjs-rails/extjs-rails.js +1 -0
- data/app/assets/javascripts/extjs-rails/index.js.erb +9 -0
- data/app/assets/javascripts/extjs-rails/sdk.jsb3 +2017 -0
- data/app/assets/javascripts/extjs-rails/src/AbstractComponent.js +3290 -0
- data/app/assets/javascripts/extjs-rails/src/AbstractManager.js +144 -0
- data/app/assets/javascripts/extjs-rails/src/AbstractPlugin.js +72 -0
- data/app/assets/javascripts/extjs-rails/src/Action.js +276 -0
- data/app/assets/javascripts/extjs-rails/src/Ajax.js +99 -0
- data/app/assets/javascripts/extjs-rails/src/Component.js +1344 -0
- data/app/assets/javascripts/extjs-rails/src/ComponentLoader.js +202 -0
- data/app/assets/javascripts/extjs-rails/src/ComponentManager.js +47 -0
- data/app/assets/javascripts/extjs-rails/src/ComponentQuery.js +521 -0
- data/app/assets/javascripts/extjs-rails/src/Editor.js +494 -0
- data/app/assets/javascripts/extjs-rails/src/ElementLoader.js +404 -0
- data/app/assets/javascripts/extjs-rails/src/FocusManager.js +712 -0
- data/app/assets/javascripts/extjs-rails/src/Img.js +111 -0
- data/app/assets/javascripts/extjs-rails/src/Layer.js +543 -0
- data/app/assets/javascripts/extjs-rails/src/LoadMask.js +432 -0
- data/app/assets/javascripts/extjs-rails/src/ModelManager.js +186 -0
- data/app/assets/javascripts/extjs-rails/src/PluginManager.js +110 -0
- data/app/assets/javascripts/extjs-rails/src/ProgressBar.js +336 -0
- data/app/assets/javascripts/extjs-rails/src/Shadow.js +233 -0
- data/app/assets/javascripts/extjs-rails/src/ShadowPool.js +43 -0
- data/app/assets/javascripts/extjs-rails/src/Template.js +331 -0
- data/app/assets/javascripts/extjs-rails/src/XTemplate.js +365 -0
- data/app/assets/javascripts/extjs-rails/src/XTemplateCompiler.js +450 -0
- data/app/assets/javascripts/extjs-rails/src/XTemplateParser.js +249 -0
- data/app/assets/javascripts/extjs-rails/src/ZIndexManager.js +519 -0
- data/app/assets/javascripts/extjs-rails/src/app/Application.js +271 -0
- data/app/assets/javascripts/extjs-rails/src/app/Controller.js +458 -0
- data/app/assets/javascripts/extjs-rails/src/app/EventBus.js +112 -0
- data/app/assets/javascripts/extjs-rails/src/button/Button.js +1483 -0
- data/app/assets/javascripts/extjs-rails/src/button/Cycle.js +215 -0
- data/app/assets/javascripts/extjs-rails/src/button/Split.js +99 -0
- data/app/assets/javascripts/extjs-rails/src/chart/Callout.js +140 -0
- data/app/assets/javascripts/extjs-rails/src/chart/Chart.js +966 -0
- data/app/assets/javascripts/extjs-rails/src/chart/Highlight.js +172 -0
- data/app/assets/javascripts/extjs-rails/src/chart/Label.js +241 -0
- data/app/assets/javascripts/extjs-rails/src/chart/Legend.js +474 -0
- data/app/assets/javascripts/extjs-rails/src/chart/LegendItem.js +217 -0
- data/app/assets/javascripts/extjs-rails/src/chart/Mask.js +230 -0
- data/app/assets/javascripts/extjs-rails/src/chart/MaskLayer.js +48 -0
- data/app/assets/javascripts/extjs-rails/src/chart/Navigation.js +79 -0
- data/app/assets/javascripts/extjs-rails/src/chart/Shape.js +106 -0
- data/app/assets/javascripts/extjs-rails/src/chart/Tip.js +98 -0
- data/app/assets/javascripts/extjs-rails/src/chart/TipSurface.js +42 -0
- data/app/assets/javascripts/extjs-rails/src/chart/axis/Abstract.js +73 -0
- data/app/assets/javascripts/extjs-rails/src/chart/axis/Axis.js +961 -0
- data/app/assets/javascripts/extjs-rails/src/chart/axis/Category.js +130 -0
- data/app/assets/javascripts/extjs-rails/src/chart/axis/Gauge.js +203 -0
- data/app/assets/javascripts/extjs-rails/src/chart/axis/Numeric.js +235 -0
- data/app/assets/javascripts/extjs-rails/src/chart/axis/Radial.js +204 -0
- data/app/assets/javascripts/extjs-rails/src/chart/axis/Time.js +135 -0
- data/app/assets/javascripts/extjs-rails/src/chart/series/Area.js +803 -0
- data/app/assets/javascripts/extjs-rails/src/chart/series/Bar.js +853 -0
- data/app/assets/javascripts/extjs-rails/src/chart/series/Cartesian.js +328 -0
- data/app/assets/javascripts/extjs-rails/src/chart/series/Column.js +104 -0
- data/app/assets/javascripts/extjs-rails/src/chart/series/Gauge.js +490 -0
- data/app/assets/javascripts/extjs-rails/src/chart/series/Line.js +1104 -0
- data/app/assets/javascripts/extjs-rails/src/chart/series/Pie.js +1072 -0
- data/app/assets/javascripts/extjs-rails/src/chart/series/Radar.js +440 -0
- data/app/assets/javascripts/extjs-rails/src/chart/series/Scatter.js +668 -0
- data/app/assets/javascripts/extjs-rails/src/chart/series/Series.js +443 -0
- data/app/assets/javascripts/extjs-rails/src/chart/theme/Base.js +175 -0
- data/app/assets/javascripts/extjs-rails/src/chart/theme/Theme.js +253 -0
- data/app/assets/javascripts/extjs-rails/src/container/AbstractContainer.js +1062 -0
- data/app/assets/javascripts/extjs-rails/src/container/ButtonGroup.js +143 -0
- data/app/assets/javascripts/extjs-rails/src/container/Container.js +212 -0
- data/app/assets/javascripts/extjs-rails/src/container/DockingContainer.js +265 -0
- data/app/assets/javascripts/extjs-rails/src/container/Viewport.js +184 -0
- data/app/assets/javascripts/extjs-rails/src/core/dom/Element.form.js +50 -0
- data/app/assets/javascripts/extjs-rails/src/core/dom/Element.static-more.js +159 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/index.html +321 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/index.js +6 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/CTO.js +25 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/CoolGuy.js +20 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Developer.js +43 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Gun.js +3 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/HumanResource.js +23 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Musician.js +20 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/Person.js +50 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/ability/CanComposeSongs.js +9 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/ability/CanPlayGuitar.js +9 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/ability/CanSing.js +18 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/A.js +3 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/B.js +3 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/C.js +3 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/D.js +3 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/deadlock/E.js +3 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/notdeadlock/A.js +3 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/notdeadlock/B.js +4 -0
- data/app/assets/javascripts/extjs-rails/src/core/examples/src/Sample/notdeadlock/C.js +3 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/EventManager.js +1167 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/EventObject.js +883 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/Ext-more.js +1283 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/Ext.js +736 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/Support.js +662 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/class/Base.js +1085 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/class/Class.js +676 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/class/ClassManager.js +1591 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/class/Loader.js +1423 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.alignment.js +173 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.insertion.js +193 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.js +681 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.position.js +356 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.static.js +474 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.style.js +851 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractElement.traversal.js +180 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractHelper.js +291 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/dom/AbstractQuery.js +72 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/dom/CompositeElement.js +75 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/dom/CompositeElementLite.js +436 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/dom/DomQuery-aria.js +1049 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/env/Browser.js +186 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/env/FeatureDetector.js +274 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/env/OS.js +141 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/lang/Array.js +1205 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/lang/Date.js +1463 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/lang/Error.js +326 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/lang/Function.js +485 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/lang/Number.js +175 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/lang/Object.js +606 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/lang/String.js +333 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/misc/JSON.js +236 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/perf/Accumulator.js +244 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/perf/Monitor.js +197 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/util/DelayedTask.js +71 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/util/Event.js +215 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/util/Format.js +551 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/util/TaskManager.js +417 -0
- data/app/assets/javascripts/extjs-rails/src/core/src/version/Version.js +364 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/README.MD +91 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/bootstrap.js +39 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/build/build-data.js +34 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/build/build.sh +2 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/data.js +27 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/index.html +15 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom.html +40 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/extjs-api.js +12 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/platform-api.js +134 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/sanity.js +4 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/touch-api-out.js +128 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/dom/touch-api.js +89 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/other_specs/env/Environment.js +357 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/resources/APITest.js +37 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/resources/jsb3.js +14 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/resources/test-setup.js +137 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/EventManager.js +629 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Ext-mess.backup +198 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Ext-more.js +520 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Ext.js +1550 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/Support.js +250 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/class/Base.js +47 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/class/Class.js +561 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/class/ClassManager.js +555 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/CompositeElementLite.js +409 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/DomHelper.js +444 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.insertion.js +342 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.js +731 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.static.js +201 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.style.js +118 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/dom/Element.traversal.js +336 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Array.js +1229 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Date.js +697 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Error.js +277 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Function.js +536 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Number.js +323 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/Object.js +591 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/lang/String.js +451 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/misc/JSON.js +252 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/util/Format.js +521 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/spec/version/Version.js +148 -0
- data/app/assets/javascripts/extjs-rails/src/core/test/unit/specs.html +19 -0
- data/app/assets/javascripts/extjs-rails/src/data/AbstractStore.js +887 -0
- data/app/assets/javascripts/extjs-rails/src/data/ArrayStore.js +74 -0
- data/app/assets/javascripts/extjs-rails/src/data/Batch.js +236 -0
- data/app/assets/javascripts/extjs-rails/src/data/BufferStore.js +13 -0
- data/app/assets/javascripts/extjs-rails/src/data/Connection.js +969 -0
- data/app/assets/javascripts/extjs-rails/src/data/DirectStore.js +50 -0
- data/app/assets/javascripts/extjs-rails/src/data/Errors.js +52 -0
- data/app/assets/javascripts/extjs-rails/src/data/Field.js +341 -0
- data/app/assets/javascripts/extjs-rails/src/data/IdGenerator.js +198 -0
- data/app/assets/javascripts/extjs-rails/src/data/JsonP.js +253 -0
- data/app/assets/javascripts/extjs-rails/src/data/JsonPStore.js +51 -0
- data/app/assets/javascripts/extjs-rails/src/data/JsonStore.js +60 -0
- data/app/assets/javascripts/extjs-rails/src/data/Model.js +1673 -0
- data/app/assets/javascripts/extjs-rails/src/data/NodeInterface.js +1294 -0
- data/app/assets/javascripts/extjs-rails/src/data/NodeStore.js +254 -0
- data/app/assets/javascripts/extjs-rails/src/data/Operation.js +331 -0
- data/app/assets/javascripts/extjs-rails/src/data/Request.js +40 -0
- data/app/assets/javascripts/extjs-rails/src/data/ResultSet.js +56 -0
- data/app/assets/javascripts/extjs-rails/src/data/SequentialIdGenerator.js +61 -0
- data/app/assets/javascripts/extjs-rails/src/data/SortTypes.js +125 -0
- data/app/assets/javascripts/extjs-rails/src/data/Store.js +2609 -0
- data/app/assets/javascripts/extjs-rails/src/data/StoreManager.js +156 -0
- data/app/assets/javascripts/extjs-rails/src/data/Tree.js +290 -0
- data/app/assets/javascripts/extjs-rails/src/data/TreeStore.js +655 -0
- data/app/assets/javascripts/extjs-rails/src/data/Types.js +190 -0
- data/app/assets/javascripts/extjs-rails/src/data/UuidGenerator.js +215 -0
- data/app/assets/javascripts/extjs-rails/src/data/XmlStore.js +76 -0
- data/app/assets/javascripts/extjs-rails/src/data/association/Association.js +243 -0
- data/app/assets/javascripts/extjs-rails/src/data/association/BelongsTo.js +291 -0
- data/app/assets/javascripts/extjs-rails/src/data/association/HasMany.js +289 -0
- data/app/assets/javascripts/extjs-rails/src/data/association/HasOne.js +304 -0
- data/app/assets/javascripts/extjs-rails/src/data/proxy/Ajax.js +282 -0
- data/app/assets/javascripts/extjs-rails/src/data/proxy/Client.js +21 -0
- data/app/assets/javascripts/extjs-rails/src/data/proxy/Direct.js +181 -0
- data/app/assets/javascripts/extjs-rails/src/data/proxy/JsonP.js +313 -0
- data/app/assets/javascripts/extjs-rails/src/data/proxy/LocalStorage.js +69 -0
- data/app/assets/javascripts/extjs-rails/src/data/proxy/Memory.js +156 -0
- data/app/assets/javascripts/extjs-rails/src/data/proxy/Proxy.js +433 -0
- data/app/assets/javascripts/extjs-rails/src/data/proxy/Rest.js +173 -0
- data/app/assets/javascripts/extjs-rails/src/data/proxy/Server.js +460 -0
- data/app/assets/javascripts/extjs-rails/src/data/proxy/SessionStorage.js +39 -0
- data/app/assets/javascripts/extjs-rails/src/data/proxy/WebStorage.js +546 -0
- data/app/assets/javascripts/extjs-rails/src/data/reader/Array.js +68 -0
- data/app/assets/javascripts/extjs-rails/src/data/reader/Json.js +383 -0
- data/app/assets/javascripts/extjs-rails/src/data/reader/Reader.js +735 -0
- data/app/assets/javascripts/extjs-rails/src/data/reader/Xml.js +292 -0
- data/app/assets/javascripts/extjs-rails/src/data/validations.js +149 -0
- data/app/assets/javascripts/extjs-rails/src/data/writer/Json.js +81 -0
- data/app/assets/javascripts/extjs-rails/src/data/writer/Writer.js +147 -0
- data/app/assets/javascripts/extjs-rails/src/data/writer/Xml.js +88 -0
- data/app/assets/javascripts/extjs-rails/src/dd/DD.js +300 -0
- data/app/assets/javascripts/extjs-rails/src/dd/DDProxy.js +204 -0
- data/app/assets/javascripts/extjs-rails/src/dd/DDTarget.js +171 -0
- data/app/assets/javascripts/extjs-rails/src/dd/DragDrop.js +1101 -0
- data/app/assets/javascripts/extjs-rails/src/dd/DragDropManager.js +1264 -0
- data/app/assets/javascripts/extjs-rails/src/dd/DragSource.js +392 -0
- data/app/assets/javascripts/extjs-rails/src/dd/DragTracker.js +562 -0
- data/app/assets/javascripts/extjs-rails/src/dd/DragZone.js +137 -0
- data/app/assets/javascripts/extjs-rails/src/dd/DropTarget.js +118 -0
- data/app/assets/javascripts/extjs-rails/src/dd/DropZone.js +254 -0
- data/app/assets/javascripts/extjs-rails/src/dd/Registry.js +117 -0
- data/app/assets/javascripts/extjs-rails/src/dd/ScrollManager.js +218 -0
- data/app/assets/javascripts/extjs-rails/src/dd/StatusProxy.js +179 -0
- data/app/assets/javascripts/extjs-rails/src/diag/layout/Context.js +523 -0
- data/app/assets/javascripts/extjs-rails/src/diag/layout/ContextItem.js +179 -0
- data/app/assets/javascripts/extjs-rails/src/direct/Event.js +35 -0
- data/app/assets/javascripts/extjs-rails/src/direct/ExceptionEvent.js +16 -0
- data/app/assets/javascripts/extjs-rails/src/direct/JsonProvider.js +82 -0
- data/app/assets/javascripts/extjs-rails/src/direct/Manager.js +263 -0
- data/app/assets/javascripts/extjs-rails/src/direct/PollingProvider.js +156 -0
- data/app/assets/javascripts/extjs-rails/src/direct/Provider.js +96 -0
- data/app/assets/javascripts/extjs-rails/src/direct/RemotingEvent.js +24 -0
- data/app/assets/javascripts/extjs-rails/src/direct/RemotingMethod.js +100 -0
- data/app/assets/javascripts/extjs-rails/src/direct/RemotingProvider.js +510 -0
- data/app/assets/javascripts/extjs-rails/src/direct/Transaction.js +41 -0
- data/app/assets/javascripts/extjs-rails/src/dom/Element.alignment.js +378 -0
- data/app/assets/javascripts/extjs-rails/src/dom/Element.anim.js +962 -0
- data/app/assets/javascripts/extjs-rails/src/dom/Element.dd.js +40 -0
- data/app/assets/javascripts/extjs-rails/src/dom/Element.fx.js +194 -0
- data/app/assets/javascripts/extjs-rails/src/dom/Element.js +1407 -0
- data/app/assets/javascripts/extjs-rails/src/dom/Element.position.js +501 -0
- data/app/assets/javascripts/extjs-rails/src/dom/Element.scroll.js +214 -0
- data/app/assets/javascripts/extjs-rails/src/dom/Element.style.js +792 -0
- data/app/assets/javascripts/extjs-rails/src/dom/Element.traversal.js +8 -0
- data/app/assets/javascripts/extjs-rails/src/dom/Helper.js +466 -0
- data/app/assets/javascripts/extjs-rails/src/dom/Query.js +1067 -0
- data/app/assets/javascripts/extjs-rails/src/draw/Color.js +303 -0
- data/app/assets/javascripts/extjs-rails/src/draw/Component.js +245 -0
- data/app/assets/javascripts/extjs-rails/src/draw/CompositeSprite.js +299 -0
- data/app/assets/javascripts/extjs-rails/src/draw/Draw.js +1217 -0
- data/app/assets/javascripts/extjs-rails/src/draw/Matrix.js +183 -0
- data/app/assets/javascripts/extjs-rails/src/draw/Sprite.js +554 -0
- data/app/assets/javascripts/extjs-rails/src/draw/SpriteDD.js +87 -0
- data/app/assets/javascripts/extjs-rails/src/draw/Surface.js +1001 -0
- data/app/assets/javascripts/extjs-rails/src/draw/Text.js +175 -0
- data/app/assets/javascripts/extjs-rails/src/draw/engine/ImageExporter.js +106 -0
- data/app/assets/javascripts/extjs-rails/src/draw/engine/Svg.js +734 -0
- data/app/assets/javascripts/extjs-rails/src/draw/engine/SvgExporter.js +280 -0
- data/app/assets/javascripts/extjs-rails/src/draw/engine/Vml.js +916 -0
- data/app/assets/javascripts/extjs-rails/src/flash/Component.js +248 -0
- data/app/assets/javascripts/extjs-rails/src/form/Basic.js +1018 -0
- data/app/assets/javascripts/extjs-rails/src/form/CheckboxGroup.js +441 -0
- data/app/assets/javascripts/extjs-rails/src/form/CheckboxManager.js +26 -0
- data/app/assets/javascripts/extjs-rails/src/form/FieldAncestor.js +210 -0
- data/app/assets/javascripts/extjs-rails/src/form/FieldContainer.js +290 -0
- data/app/assets/javascripts/extjs-rails/src/form/FieldSet.js +506 -0
- data/app/assets/javascripts/extjs-rails/src/form/Label.js +110 -0
- data/app/assets/javascripts/extjs-rails/src/form/Labelable.js +764 -0
- data/app/assets/javascripts/extjs-rails/src/form/Panel.js +335 -0
- data/app/assets/javascripts/extjs-rails/src/form/RadioGroup.js +124 -0
- data/app/assets/javascripts/extjs-rails/src/form/RadioManager.js +26 -0
- data/app/assets/javascripts/extjs-rails/src/form/action/Action.js +307 -0
- data/app/assets/javascripts/extjs-rails/src/form/action/DirectLoad.js +107 -0
- data/app/assets/javascripts/extjs-rails/src/form/action/DirectSubmit.js +119 -0
- data/app/assets/javascripts/extjs-rails/src/form/action/Load.js +120 -0
- data/app/assets/javascripts/extjs-rails/src/form/action/StandardSubmit.js +34 -0
- data/app/assets/javascripts/extjs-rails/src/form/action/Submit.js +257 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/Base.js +813 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/Checkbox.js +505 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/ComboBox.js +1427 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/Date.js +578 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/Display.js +155 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/Field.js +430 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/File.js +265 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/Hidden.js +75 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/HtmlEditor.js +1439 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/Number.js +380 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/Picker.js +321 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/Radio.js +279 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/Spinner.js +321 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/Text.js +727 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/TextArea.js +228 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/Time.js +459 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/Trigger.js +469 -0
- data/app/assets/javascripts/extjs-rails/src/form/field/VTypes.js +172 -0
- data/app/assets/javascripts/extjs-rails/src/fx/Anim.js +472 -0
- data/app/assets/javascripts/extjs-rails/src/fx/Animator.js +410 -0
- data/app/assets/javascripts/extjs-rails/src/fx/CubicBezier.js +77 -0
- data/app/assets/javascripts/extjs-rails/src/fx/Easing.js +136 -0
- data/app/assets/javascripts/extjs-rails/src/fx/Manager.js +353 -0
- data/app/assets/javascripts/extjs-rails/src/fx/PropertyHandler.js +381 -0
- data/app/assets/javascripts/extjs-rails/src/fx/Queue.js +123 -0
- data/app/assets/javascripts/extjs-rails/src/fx/target/Component.js +118 -0
- data/app/assets/javascripts/extjs-rails/src/fx/target/CompositeElement.js +46 -0
- data/app/assets/javascripts/extjs-rails/src/fx/target/CompositeElementCSS.js +22 -0
- data/app/assets/javascripts/extjs-rails/src/fx/target/CompositeSprite.js +34 -0
- data/app/assets/javascripts/extjs-rails/src/fx/target/Element.js +83 -0
- data/app/assets/javascripts/extjs-rails/src/fx/target/ElementCSS.js +77 -0
- data/app/assets/javascripts/extjs-rails/src/fx/target/Sprite.js +128 -0
- data/app/assets/javascripts/extjs-rails/src/fx/target/Target.js +36 -0
- data/app/assets/javascripts/extjs-rails/src/grid/CellEditor.js +172 -0
- data/app/assets/javascripts/extjs-rails/src/grid/ColumnComponentLayout.js +34 -0
- data/app/assets/javascripts/extjs-rails/src/grid/ColumnLayout.js +201 -0
- data/app/assets/javascripts/extjs-rails/src/grid/Lockable.js +863 -0
- data/app/assets/javascripts/extjs-rails/src/grid/LockingView.js +169 -0
- data/app/assets/javascripts/extjs-rails/src/grid/PagingScroller.js +539 -0
- data/app/assets/javascripts/extjs-rails/src/grid/Panel.js +393 -0
- data/app/assets/javascripts/extjs-rails/src/grid/RowEditor.js +731 -0
- data/app/assets/javascripts/extjs-rails/src/grid/RowNumberer.js +76 -0
- data/app/assets/javascripts/extjs-rails/src/grid/Scroller.js +5 -0
- data/app/assets/javascripts/extjs-rails/src/grid/View.js +44 -0
- data/app/assets/javascripts/extjs-rails/src/grid/ViewDropZone.js +41 -0
- data/app/assets/javascripts/extjs-rails/src/grid/column/Action.js +318 -0
- data/app/assets/javascripts/extjs-rails/src/grid/column/Boolean.js +82 -0
- data/app/assets/javascripts/extjs-rails/src/grid/column/Column.js +835 -0
- data/app/assets/javascripts/extjs-rails/src/grid/column/Date.js +63 -0
- data/app/assets/javascripts/extjs-rails/src/grid/column/Number.js +52 -0
- data/app/assets/javascripts/extjs-rails/src/grid/column/Template.js +58 -0
- data/app/assets/javascripts/extjs-rails/src/grid/feature/AbstractSummary.js +154 -0
- data/app/assets/javascripts/extjs-rails/src/grid/feature/Chunking.js +77 -0
- data/app/assets/javascripts/extjs-rails/src/grid/feature/Feature.js +158 -0
- data/app/assets/javascripts/extjs-rails/src/grid/feature/Grouping.js +822 -0
- data/app/assets/javascripts/extjs-rails/src/grid/feature/GroupingSummary.js +243 -0
- data/app/assets/javascripts/extjs-rails/src/grid/feature/RowBody.js +116 -0
- data/app/assets/javascripts/extjs-rails/src/grid/feature/RowWrap.js +120 -0
- data/app/assets/javascripts/extjs-rails/src/grid/feature/Summary.js +167 -0
- data/app/assets/javascripts/extjs-rails/src/grid/header/Container.js +965 -0
- data/app/assets/javascripts/extjs-rails/src/grid/header/DragZone.js +69 -0
- data/app/assets/javascripts/extjs-rails/src/grid/header/DropZone.js +265 -0
- data/app/assets/javascripts/extjs-rails/src/grid/plugin/CellEditing.js +453 -0
- data/app/assets/javascripts/extjs-rails/src/grid/plugin/DragDrop.js +254 -0
- data/app/assets/javascripts/extjs-rails/src/grid/plugin/Editing.js +561 -0
- data/app/assets/javascripts/extjs-rails/src/grid/plugin/HeaderReorderer.js +49 -0
- data/app/assets/javascripts/extjs-rails/src/grid/plugin/HeaderResizer.js +292 -0
- data/app/assets/javascripts/extjs-rails/src/grid/plugin/RowEditing.js +339 -0
- data/app/assets/javascripts/extjs-rails/src/grid/property/Grid.js +351 -0
- data/app/assets/javascripts/extjs-rails/src/grid/property/HeaderContainer.js +109 -0
- data/app/assets/javascripts/extjs-rails/src/grid/property/Property.js +36 -0
- data/app/assets/javascripts/extjs-rails/src/grid/property/Store.js +141 -0
- data/app/assets/javascripts/extjs-rails/src/layout/ClassList.js +90 -0
- data/app/assets/javascripts/extjs-rails/src/layout/Context.js +1232 -0
- data/app/assets/javascripts/extjs-rails/src/layout/ContextItem.js +1470 -0
- data/app/assets/javascripts/extjs-rails/src/layout/Layout.js +761 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/Auto.js +220 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/Body.js +80 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/BoundList.js +95 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/Button.js +261 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/Component.js +427 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/Dock.js +1132 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/Draw.js +79 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/FieldSet.js +62 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/ProgressBar.js +54 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/Tab.js +23 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/field/ComboBox.js +52 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/field/Field.js +372 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/field/FieldContainer.js +48 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/field/HtmlEditor.js +54 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/field/Slider.js +58 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/field/Text.js +75 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/field/TextArea.js +51 -0
- data/app/assets/javascripts/extjs-rails/src/layout/component/field/Trigger.js +132 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Absolute.js +121 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Accordion.js +308 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Anchor.js +403 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Auto.js +70 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Border-old-js +1079 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Border.js +816 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Box.js +929 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Card.js +361 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/CheckboxGroup.js +376 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Column.js +234 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Container.js +961 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Editor.js +74 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Fit.js +287 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Form.js +157 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/HBox.js +134 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/Table.js +412 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/VBox.js +139 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/boxOverflow/Menu.js +365 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/boxOverflow/None.js +83 -0
- data/app/assets/javascripts/extjs-rails/src/layout/container/boxOverflow/Scroller.js +475 -0
- data/app/assets/javascripts/extjs-rails/src/menu/CheckItem.js +169 -0
- data/app/assets/javascripts/extjs-rails/src/menu/ColorPicker.js +110 -0
- data/app/assets/javascripts/extjs-rails/src/menu/DatePicker.js +100 -0
- data/app/assets/javascripts/extjs-rails/src/menu/Item.js +553 -0
- data/app/assets/javascripts/extjs-rails/src/menu/KeyNav.js +134 -0
- data/app/assets/javascripts/extjs-rails/src/menu/Manager.js +219 -0
- data/app/assets/javascripts/extjs-rails/src/menu/Menu.js +579 -0
- data/app/assets/javascripts/extjs-rails/src/menu/Separator.js +126 -0
- data/app/assets/javascripts/extjs-rails/src/panel/AbstractPanel.js +323 -0
- data/app/assets/javascripts/extjs-rails/src/panel/DD.js +99 -0
- data/app/assets/javascripts/extjs-rails/src/panel/Header.js +518 -0
- data/app/assets/javascripts/extjs-rails/src/panel/Panel.js +2150 -0
- data/app/assets/javascripts/extjs-rails/src/panel/Proxy.js +131 -0
- data/app/assets/javascripts/extjs-rails/src/panel/Table.js +1018 -0
- data/app/assets/javascripts/extjs-rails/src/panel/Tool.js +304 -0
- data/app/assets/javascripts/extjs-rails/src/picker/Color.js +219 -0
- data/app/assets/javascripts/extjs-rails/src/picker/Date.js +1140 -0
- data/app/assets/javascripts/extjs-rails/src/picker/Month.js +490 -0
- data/app/assets/javascripts/extjs-rails/src/picker/Time.js +165 -0
- data/app/assets/javascripts/extjs-rails/src/resizer/BorderSplitter.js +22 -0
- data/app/assets/javascripts/extjs-rails/src/resizer/BorderSplitterTracker.js +210 -0
- data/app/assets/javascripts/extjs-rails/src/resizer/Handle.js +29 -0
- data/app/assets/javascripts/extjs-rails/src/resizer/ResizeTracker.js +346 -0
- data/app/assets/javascripts/extjs-rails/src/resizer/Resizer.js +477 -0
- data/app/assets/javascripts/extjs-rails/src/resizer/Splitter.js +242 -0
- data/app/assets/javascripts/extjs-rails/src/resizer/SplitterTracker.js +230 -0
- data/app/assets/javascripts/extjs-rails/src/selection/CellModel.js +395 -0
- data/app/assets/javascripts/extjs-rails/src/selection/CheckboxModel.js +234 -0
- data/app/assets/javascripts/extjs-rails/src/selection/DataViewModel.js +160 -0
- data/app/assets/javascripts/extjs-rails/src/selection/Model.js +646 -0
- data/app/assets/javascripts/extjs-rails/src/selection/RowModel.js +499 -0
- data/app/assets/javascripts/extjs-rails/src/selection/TreeModel.js +78 -0
- data/app/assets/javascripts/extjs-rails/src/slider/Multi.js +835 -0
- data/app/assets/javascripts/extjs-rails/src/slider/Single.js +56 -0
- data/app/assets/javascripts/extjs-rails/src/slider/Thumb.js +259 -0
- data/app/assets/javascripts/extjs-rails/src/slider/Tip.js +130 -0
- data/app/assets/javascripts/extjs-rails/src/state/CookieProvider.js +120 -0
- data/app/assets/javascripts/extjs-rails/src/state/LocalStorageProvider.js +72 -0
- data/app/assets/javascripts/extjs-rails/src/state/Manager.js +70 -0
- data/app/assets/javascripts/extjs-rails/src/state/Provider.js +182 -0
- data/app/assets/javascripts/extjs-rails/src/state/Stateful.js +364 -0
- data/app/assets/javascripts/extjs-rails/src/tab/Bar.js +258 -0
- data/app/assets/javascripts/extjs-rails/src/tab/Panel.js +654 -0
- data/app/assets/javascripts/extjs-rails/src/tab/Tab.js +358 -0
- data/app/assets/javascripts/extjs-rails/src/tail.js +10 -0
- data/app/assets/javascripts/extjs-rails/src/tip/QuickTip.js +335 -0
- data/app/assets/javascripts/extjs-rails/src/tip/QuickTipManager.js +239 -0
- data/app/assets/javascripts/extjs-rails/src/tip/Tip.js +160 -0
- data/app/assets/javascripts/extjs-rails/src/tip/ToolTip.js +691 -0
- data/app/assets/javascripts/extjs-rails/src/toolbar/Fill.js +28 -0
- data/app/assets/javascripts/extjs-rails/src/toolbar/Item.js +16 -0
- data/app/assets/javascripts/extjs-rails/src/toolbar/Paging.js +600 -0
- data/app/assets/javascripts/extjs-rails/src/toolbar/Separator.js +23 -0
- data/app/assets/javascripts/extjs-rails/src/toolbar/Spacer.js +33 -0
- data/app/assets/javascripts/extjs-rails/src/toolbar/TextItem.js +57 -0
- data/app/assets/javascripts/extjs-rails/src/toolbar/Toolbar-legacy.js +123 -0
- data/app/assets/javascripts/extjs-rails/src/toolbar/Toolbar.js +447 -0
- data/app/assets/javascripts/extjs-rails/src/tree/Column.js +90 -0
- data/app/assets/javascripts/extjs-rails/src/tree/Panel.js +505 -0
- data/app/assets/javascripts/extjs-rails/src/tree/View.js +658 -0
- data/app/assets/javascripts/extjs-rails/src/tree/ViewDragZone.js +49 -0
- data/app/assets/javascripts/extjs-rails/src/tree/ViewDropZone.js +287 -0
- data/app/assets/javascripts/extjs-rails/src/tree/plugin/TreeViewDragDrop.js +244 -0
- data/app/assets/javascripts/extjs-rails/src/util/AbstractMixedCollection.js +772 -0
- data/app/assets/javascripts/extjs-rails/src/util/Animate.js +426 -0
- data/app/assets/javascripts/extjs-rails/src/util/Bindable.js +102 -0
- data/app/assets/javascripts/extjs-rails/src/util/CSS.js +185 -0
- data/app/assets/javascripts/extjs-rails/src/util/ClickRepeater.js +238 -0
- data/app/assets/javascripts/extjs-rails/src/util/ComponentDragger.js +126 -0
- data/app/assets/javascripts/extjs-rails/src/util/Cookies.js +91 -0
- data/app/assets/javascripts/extjs-rails/src/util/ElementContainer.js +293 -0
- data/app/assets/javascripts/extjs-rails/src/util/Filter.js +159 -0
- data/app/assets/javascripts/extjs-rails/src/util/Floating.js +321 -0
- data/app/assets/javascripts/extjs-rails/src/util/Grouper.js +26 -0
- data/app/assets/javascripts/extjs-rails/src/util/HashMap.js +356 -0
- data/app/assets/javascripts/extjs-rails/src/util/History.js +285 -0
- data/app/assets/javascripts/extjs-rails/src/util/Inflector.js +297 -0
- data/app/assets/javascripts/extjs-rails/src/util/KeyMap.js +427 -0
- data/app/assets/javascripts/extjs-rails/src/util/KeyNav.js +239 -0
- data/app/assets/javascripts/extjs-rails/src/util/LruCache.js +257 -0
- data/app/assets/javascripts/extjs-rails/src/util/Memento.js +131 -0
- data/app/assets/javascripts/extjs-rails/src/util/MixedCollection.js +239 -0
- data/app/assets/javascripts/extjs-rails/src/util/Observable.js +1003 -0
- data/app/assets/javascripts/extjs-rails/src/util/Offset.js +60 -0
- data/app/assets/javascripts/extjs-rails/src/util/Point.js +93 -0
- data/app/assets/javascripts/extjs-rails/src/util/ProtoElement.js +205 -0
- data/app/assets/javascripts/extjs-rails/src/util/Queue.js +76 -0
- data/app/assets/javascripts/extjs-rails/src/util/Region.js +388 -0
- data/app/assets/javascripts/extjs-rails/src/util/Renderable.js +1079 -0
- data/app/assets/javascripts/extjs-rails/src/util/Sortable.js +248 -0
- data/app/assets/javascripts/extjs-rails/src/util/Sorter.js +179 -0
- data/app/assets/javascripts/extjs-rails/src/util/TextMetrics.js +148 -0
- data/app/assets/javascripts/extjs-rails/src/view/AbstractView.js +1103 -0
- data/app/assets/javascripts/extjs-rails/src/view/BoundList.js +207 -0
- data/app/assets/javascripts/extjs-rails/src/view/BoundListKeyNav.js +92 -0
- data/app/assets/javascripts/extjs-rails/src/view/DragZone.js +106 -0
- data/app/assets/javascripts/extjs-rails/src/view/DropZone.js +240 -0
- data/app/assets/javascripts/extjs-rails/src/view/Table.js +1229 -0
- data/app/assets/javascripts/extjs-rails/src/view/TableChunker.js +139 -0
- data/app/assets/javascripts/extjs-rails/src/view/View.js +636 -0
- data/app/assets/javascripts/extjs-rails/src/window/MessageBox.js +880 -0
- data/app/assets/javascripts/extjs-rails/src/window/Window-legacy.js +56 -0
- data/app/assets/javascripts/extjs-rails/src/window/Window.js +793 -0
- data/extjs-rails.gemspec +24 -0
- data/lib/extjs-rails.rb +7 -0
- data/lib/extjs-rails/engine.rb +7 -0
- data/lib/extjs-rails/version.rb +5 -0
- metadata +660 -0
|
@@ -0,0 +1,1470 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This class manages state information for a component or element during a layout.
|
|
3
|
+
*
|
|
4
|
+
* # Blocks
|
|
5
|
+
*
|
|
6
|
+
* A "block" is a required value that is preventing further calculation. When a layout has
|
|
7
|
+
* encountered a situation where it cannot possibly calculate results, it can associate
|
|
8
|
+
* itself with the context item and missing property so that it will not be rescheduled
|
|
9
|
+
* until that property is set.
|
|
10
|
+
*
|
|
11
|
+
* Blocks are a one-shot registration. Once the property changes, the block is removed.
|
|
12
|
+
*
|
|
13
|
+
* Be careful with blocks. If *any* further calculations can be made, a block is not the
|
|
14
|
+
* right choice.
|
|
15
|
+
*
|
|
16
|
+
* # Triggers
|
|
17
|
+
*
|
|
18
|
+
* Whenever any call to {@link #getProp}, {@link #getDomProp}, {@link #hasProp} or
|
|
19
|
+
* {@link #hasDomProp} is made, the current layout is automatically registered as being
|
|
20
|
+
* dependent on that property in the appropriate state. Any changes to the property will
|
|
21
|
+
* trigger the layout and it will be queued in the {@link Ext.layout.Context}.
|
|
22
|
+
*
|
|
23
|
+
* Triggers, once added, remain for the entire layout. Any changes to the property will
|
|
24
|
+
* reschedule all unfinished layouts in their trigger set.
|
|
25
|
+
* @protected
|
|
26
|
+
*/
|
|
27
|
+
Ext.define('Ext.layout.ContextItem', {
|
|
28
|
+
|
|
29
|
+
requires: ['Ext.layout.ClassList'],
|
|
30
|
+
|
|
31
|
+
heightModel: null,
|
|
32
|
+
widthModel: null,
|
|
33
|
+
sizeModel: null,
|
|
34
|
+
|
|
35
|
+
boxChildren: null,
|
|
36
|
+
|
|
37
|
+
boxParent: null,
|
|
38
|
+
|
|
39
|
+
children: [],
|
|
40
|
+
|
|
41
|
+
dirty: null,
|
|
42
|
+
|
|
43
|
+
// The number of dirty properties
|
|
44
|
+
dirtyCount: 0,
|
|
45
|
+
|
|
46
|
+
hasRawContent: true,
|
|
47
|
+
|
|
48
|
+
isContextItem: true,
|
|
49
|
+
|
|
50
|
+
isTopLevel: false,
|
|
51
|
+
|
|
52
|
+
consumersContentHeight: 0,
|
|
53
|
+
consumersContentWidth: 0,
|
|
54
|
+
consumersContainerHeight: 0,
|
|
55
|
+
consumersContainerWidth: 0,
|
|
56
|
+
consumersHeight: 0,
|
|
57
|
+
consumersWidth: 0,
|
|
58
|
+
|
|
59
|
+
ownerCtContext: null,
|
|
60
|
+
|
|
61
|
+
remainingChildLayouts: 0,
|
|
62
|
+
remainingComponentChildLayouts: 0,
|
|
63
|
+
remainingContainerChildLayouts: 0,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @property {Boolean} wrapsComponent
|
|
67
|
+
* True if this item wraps a Component (rather than an Element).
|
|
68
|
+
* @readonly
|
|
69
|
+
*/
|
|
70
|
+
wrapsComponent: false,
|
|
71
|
+
|
|
72
|
+
constructor: function (config) {
|
|
73
|
+
var me = this,
|
|
74
|
+
target = config.target, // target must come in as a config
|
|
75
|
+
el, sizeModel;
|
|
76
|
+
|
|
77
|
+
Ext.apply(me, config);
|
|
78
|
+
|
|
79
|
+
el = me.el;
|
|
80
|
+
me.id = el.id;
|
|
81
|
+
me.lastBox = el.lastBox;
|
|
82
|
+
|
|
83
|
+
// These hold collections of layouts that are either blocked or triggered by sets
|
|
84
|
+
// to our properties (either ASAP or after flushing to the DOM). All of them have
|
|
85
|
+
// the same structure:
|
|
86
|
+
//
|
|
87
|
+
// me.blocks = {
|
|
88
|
+
// width: {
|
|
89
|
+
// 'layout-1001': layout1001
|
|
90
|
+
// }
|
|
91
|
+
// }
|
|
92
|
+
//
|
|
93
|
+
// The property name is the primary key which yields an object keyed by layout id
|
|
94
|
+
// with the layout instance as the value. This prevents duplicate entries for one
|
|
95
|
+
// layout and gives O(1) access to the layout instance when we need to iterate and
|
|
96
|
+
// process them.
|
|
97
|
+
//
|
|
98
|
+
me.blocks = {};
|
|
99
|
+
me.domBlocks = {};
|
|
100
|
+
me.triggers = {};
|
|
101
|
+
me.domTriggers = {};
|
|
102
|
+
|
|
103
|
+
me.flushedProps = {};
|
|
104
|
+
|
|
105
|
+
// the current set of property values:
|
|
106
|
+
me.props = {};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @property {Object} state
|
|
110
|
+
* State variables that are cleared when invalidated.
|
|
111
|
+
*/
|
|
112
|
+
me.state = {};
|
|
113
|
+
|
|
114
|
+
// the set of cached styles for the element:
|
|
115
|
+
me.styles = {};
|
|
116
|
+
|
|
117
|
+
if (target.isComponent) {
|
|
118
|
+
me.wrapsComponent = true;
|
|
119
|
+
me.sizeModel = sizeModel = target.getSizeModel(me.ownerCtContext && me.ownerCtContext.sizeModel);
|
|
120
|
+
me.widthModel = sizeModel.width;
|
|
121
|
+
me.heightModel = sizeModel.height;
|
|
122
|
+
me.frameBodyContext = me.getEl('frameBody');
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Initializes ContextItem.
|
|
128
|
+
* @param ownerCtContext
|
|
129
|
+
*/
|
|
130
|
+
init: function (ownerCtContext) {
|
|
131
|
+
var me = this,
|
|
132
|
+
boxParent, widthModel;
|
|
133
|
+
|
|
134
|
+
if (ownerCtContext) {
|
|
135
|
+
me.ownerCtContext = ownerCtContext;
|
|
136
|
+
me.isBoxParent = me.target.ownerLayout.isItemBoxParent(me);
|
|
137
|
+
|
|
138
|
+
widthModel = me.widthModel;
|
|
139
|
+
|
|
140
|
+
if (widthModel.shrinkWrap) {
|
|
141
|
+
boxParent = ownerCtContext.isBoxParent ? ownerCtContext : ownerCtContext.boxParent;
|
|
142
|
+
if (boxParent) {
|
|
143
|
+
boxParent.addBoxChild(me);
|
|
144
|
+
}
|
|
145
|
+
} else if (widthModel.natural) {
|
|
146
|
+
me.boxParent = ownerCtContext;
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
me.isTopLevel = true;
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
initAnimatePolicy: function() {
|
|
154
|
+
var me = this,
|
|
155
|
+
target = me.target,
|
|
156
|
+
ownerCtContext = me.ownerCtContext;
|
|
157
|
+
|
|
158
|
+
if (ownerCtContext && ownerCtContext.isTopLevel) {
|
|
159
|
+
// See which properties we are supposed to animate to their new state.
|
|
160
|
+
// If there are any, queue ourself to be animated by the owning Context
|
|
161
|
+
me.animatePolicy = target.ownerLayout.getAnimatePolicy(me);
|
|
162
|
+
}
|
|
163
|
+
// Collapsing/expnding a top level Panel with animation.
|
|
164
|
+
// We need to fabricate an animatePolicy depending on which dimension the collapse is using,
|
|
165
|
+
// isCollapsingOrExpanding is set during the collapse/expand process.
|
|
166
|
+
else if (!ownerCtContext && target.isCollapsingOrExpanding && target.animCollapse) {
|
|
167
|
+
me.animatePolicy = target.componentLayout.getAnimatePolicy(me);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (me.animatePolicy) {
|
|
171
|
+
me.context.queueAnimation(me);
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
noFraming: { left: 0, top: 0, right: 0, bottom: 0, width: 0, height: 0 },
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Queue the addition of a class name (or array of class names) to this ContextItem's target when next flushed.
|
|
179
|
+
*/
|
|
180
|
+
addCls: function(newCls) {
|
|
181
|
+
this.getClassList().addMany(newCls);
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Queue the removal of a class name (or array of class names) from this ContextItem's target when next flushed.
|
|
186
|
+
*/
|
|
187
|
+
removeCls: function(removeCls) {
|
|
188
|
+
this.getClassList().removeMany(removeCls);
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Adds a block.
|
|
193
|
+
*
|
|
194
|
+
* @param {String} name The name of the block list ('blocks' or 'domBlocks').
|
|
195
|
+
* @param {Ext.layout.Layout} layout The layout that is blocked.
|
|
196
|
+
* @param {String} propName The property name that blocked the layout (e.g., 'width').
|
|
197
|
+
* @private
|
|
198
|
+
*/
|
|
199
|
+
addBlock: function (name, layout, propName) {
|
|
200
|
+
var me = this,
|
|
201
|
+
collection = me[name],
|
|
202
|
+
blockedLayouts = collection[propName] || (collection[propName] = {});
|
|
203
|
+
|
|
204
|
+
if (!blockedLayouts[layout.id]) {
|
|
205
|
+
blockedLayouts[layout.id] = layout;
|
|
206
|
+
++layout.blockCount;
|
|
207
|
+
++me.context.blockCount;
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
addBoxChild: function (boxChildItem) {
|
|
212
|
+
var me = this,
|
|
213
|
+
children,
|
|
214
|
+
widthModel = boxChildItem.widthModel;
|
|
215
|
+
|
|
216
|
+
boxChildItem.boxParent = this;
|
|
217
|
+
|
|
218
|
+
// Children that are widthModel.auto (regardless of heightModel) that measure the
|
|
219
|
+
// DOM (by virtue of hasRawContent), need to wait for their "box parent" to be sized.
|
|
220
|
+
// If they measure too early, they will be wrong results. In the widthModel.shrinkWrap
|
|
221
|
+
// case, the boxParent "crushes" the child. In the case of widthModel.natural, the
|
|
222
|
+
// boxParent's width is likely a key part of the child's width (e.g., "50%" or just
|
|
223
|
+
// normal block-level behavior of 100% width)
|
|
224
|
+
boxChildItem.measuresBox = widthModel.shrinkWrap ? boxChildItem.hasRawContent : widthModel.natural;
|
|
225
|
+
|
|
226
|
+
if (boxChildItem.measuresBox) {
|
|
227
|
+
children = me.boxChildren;
|
|
228
|
+
|
|
229
|
+
if (children) {
|
|
230
|
+
children.push(boxChildItem);
|
|
231
|
+
} else {
|
|
232
|
+
me.boxChildren = [ boxChildItem ];
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Adds a trigger.
|
|
239
|
+
*
|
|
240
|
+
* @param {String} propName The property name that triggers the layout (e.g., 'width').
|
|
241
|
+
* @param {Boolean} inDom True if the trigger list is `domTriggers`, false if `triggers`.
|
|
242
|
+
* @private
|
|
243
|
+
*/
|
|
244
|
+
addTrigger: function (propName, inDom) {
|
|
245
|
+
var me = this,
|
|
246
|
+
collection = inDom ? me.domTriggers : me.triggers,
|
|
247
|
+
context = me.context,
|
|
248
|
+
layout = context.currentLayout,
|
|
249
|
+
triggers = collection[propName] || (collection[propName] = {});
|
|
250
|
+
|
|
251
|
+
if (!triggers[layout.id]) {
|
|
252
|
+
triggers[layout.id] = layout;
|
|
253
|
+
++layout.triggerCount;
|
|
254
|
+
|
|
255
|
+
triggers = context.triggers[inDom ? 'dom' : 'data'];
|
|
256
|
+
(triggers[layout.id] || (triggers[layout.id] = [])).push({
|
|
257
|
+
item: this,
|
|
258
|
+
prop: propName
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
if (me.props[propName] !== undefined) {
|
|
262
|
+
if (!inDom || !(me.dirty && (propName in me.dirty))) {
|
|
263
|
+
++layout.firedTriggers;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
|
|
269
|
+
boxChildMeasured: function () {
|
|
270
|
+
var me = this,
|
|
271
|
+
state = me.state,
|
|
272
|
+
count = (state.boxesMeasured = (state.boxesMeasured || 0) + 1);
|
|
273
|
+
|
|
274
|
+
if (count == me.boxChildren.length) {
|
|
275
|
+
// all of our children have measured themselves, so we can clear the width
|
|
276
|
+
// and resume layouts for this component...
|
|
277
|
+
state.clearBoxWidth = 1;
|
|
278
|
+
++me.context.progressCount;
|
|
279
|
+
me.markDirty();
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
|
|
283
|
+
borderNames: [ 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'],
|
|
284
|
+
marginNames: [ 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ],
|
|
285
|
+
paddingNames: [ 'padding-top', 'padding-right', 'padding-bottom', 'padding-left' ],
|
|
286
|
+
trblNames: [ 'top', 'right', 'bottom', 'left' ],
|
|
287
|
+
|
|
288
|
+
cacheMissHandlers: {
|
|
289
|
+
borderInfo: function (me) {
|
|
290
|
+
var info = me.getStyles(me.borderNames, me.trblNames);
|
|
291
|
+
|
|
292
|
+
info.width = info.left + info.right;
|
|
293
|
+
info.height = info.top + info.bottom;
|
|
294
|
+
|
|
295
|
+
return info;
|
|
296
|
+
},
|
|
297
|
+
|
|
298
|
+
marginInfo: function (me) {
|
|
299
|
+
var info = me.getStyles(me.marginNames, me.trblNames);
|
|
300
|
+
|
|
301
|
+
info.width = info.left + info.right;
|
|
302
|
+
info.height = info.top + info.bottom;
|
|
303
|
+
|
|
304
|
+
return info;
|
|
305
|
+
},
|
|
306
|
+
|
|
307
|
+
paddingInfo: function (me) {
|
|
308
|
+
// if this context item's target is a framed component the padding is on the frameBody, not on the main el
|
|
309
|
+
var item = me.frameBodyContext || me,
|
|
310
|
+
info = item.getStyles(me.paddingNames, me.trblNames);
|
|
311
|
+
|
|
312
|
+
info.width = info.left + info.right;
|
|
313
|
+
info.height = info.top + info.bottom;
|
|
314
|
+
|
|
315
|
+
return info;
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
|
|
319
|
+
checkCache: function (entry) {
|
|
320
|
+
return this.cacheMissHandlers[entry](this);
|
|
321
|
+
},
|
|
322
|
+
|
|
323
|
+
clearAllBlocks: function (name) {
|
|
324
|
+
var collection = this[name],
|
|
325
|
+
propName;
|
|
326
|
+
|
|
327
|
+
if (collection) {
|
|
328
|
+
for (propName in collection) {
|
|
329
|
+
this.clearBlocks(name, propName);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Removes any blocks on a property in the specified set. Any layouts that were blocked
|
|
336
|
+
* by this property and are not still blocked (by other properties) will be rescheduled.
|
|
337
|
+
*
|
|
338
|
+
* @param {String} name The name of the block list ('blocks' or 'domBlocks').
|
|
339
|
+
* @param {String} propName The property name that blocked the layout (e.g., 'width').
|
|
340
|
+
* @private
|
|
341
|
+
*/
|
|
342
|
+
clearBlocks: function (name, propName) {
|
|
343
|
+
var collection = this[name],
|
|
344
|
+
blockedLayouts = collection && collection[propName],
|
|
345
|
+
context, layout, layoutId;
|
|
346
|
+
|
|
347
|
+
if (blockedLayouts) {
|
|
348
|
+
delete collection[propName];
|
|
349
|
+
|
|
350
|
+
context = this.context;
|
|
351
|
+
|
|
352
|
+
for (layoutId in blockedLayouts) {
|
|
353
|
+
layout = blockedLayouts[layoutId];
|
|
354
|
+
|
|
355
|
+
--context.blockCount;
|
|
356
|
+
if (! --layout.blockCount && !layout.pending && !layout.done) {
|
|
357
|
+
context.queueLayout(layout);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Registers a layout in the block list for the given property. Once the property is
|
|
365
|
+
* set in the {@link Ext.layout.Context}, the layout is unblocked.
|
|
366
|
+
*
|
|
367
|
+
* @param {Ext.layout.Layout} layout
|
|
368
|
+
* @param {String} propName The property name that blocked the layout (e.g., 'width').
|
|
369
|
+
*/
|
|
370
|
+
block: function (layout, propName) {
|
|
371
|
+
this.addBlock('blocks', layout, propName);
|
|
372
|
+
},
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Registers a layout in the DOM block list for the given property. Once the property
|
|
376
|
+
* flushed to the DOM by the {@link Ext.layout.Context}, the layout is unblocked.
|
|
377
|
+
*
|
|
378
|
+
* @param {Ext.layout.Layout} layout
|
|
379
|
+
* @param {String} propName The property name that blocked the layout (e.g., 'width').
|
|
380
|
+
*/
|
|
381
|
+
domBlock: function (layout, propName) {
|
|
382
|
+
this.addBlock('domBlocks', layout, propName);
|
|
383
|
+
},
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Clears all properties on this object except (perhaps) those not calculated by this
|
|
387
|
+
* component. This is more complex than it would seem because a layout can decide to
|
|
388
|
+
* invalidate its results and run the component's layouts again, but since some of the
|
|
389
|
+
* values may be calculated by the container, care must be taken to preserve those
|
|
390
|
+
* values.
|
|
391
|
+
*
|
|
392
|
+
* @param {Boolean} full True if all properties are to be invalidated, false to keep
|
|
393
|
+
* those calculated by the ownerCt.
|
|
394
|
+
*/
|
|
395
|
+
doInvalidate: function (full) {
|
|
396
|
+
var me = this,
|
|
397
|
+
oldProps = me.props,
|
|
398
|
+
oldDirty = me.dirty,
|
|
399
|
+
ownerLayout = me.target.ownerLayout;
|
|
400
|
+
|
|
401
|
+
me.dirty = me.invalid = false;
|
|
402
|
+
me.props = {};
|
|
403
|
+
me.state = {};
|
|
404
|
+
|
|
405
|
+
me.clearAllBlocks('blocks');
|
|
406
|
+
me.clearAllBlocks('domBlocks');
|
|
407
|
+
|
|
408
|
+
// If we had dirty properties and we are not fully invalidating, we need to recover
|
|
409
|
+
// some of thos values...
|
|
410
|
+
if (me.wrapsComponent) {
|
|
411
|
+
if (!full) {
|
|
412
|
+
// these are almost always calculated by the ownerCt (we might need to track
|
|
413
|
+
// this at some point more carefully):
|
|
414
|
+
me.recoverProp('x', oldProps, oldDirty);
|
|
415
|
+
me.recoverProp('y', oldProps, oldDirty);
|
|
416
|
+
|
|
417
|
+
// if these are calculated by the ownerCt, don't trash them:
|
|
418
|
+
if (me.widthModel.calculated) {
|
|
419
|
+
me.recoverProp('width', oldProps, oldDirty);
|
|
420
|
+
}
|
|
421
|
+
if (me.heightModel.calculated) {
|
|
422
|
+
me.recoverProp('height', oldProps, oldDirty);
|
|
423
|
+
}
|
|
424
|
+
} else {
|
|
425
|
+
me.widthModel = me.sizeModel.width;
|
|
426
|
+
me.heightModel = me.sizeModel.height;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
if (ownerLayout && ownerLayout.manageMargins) {
|
|
432
|
+
me.recoverProp('margin-top', oldProps, oldDirty);
|
|
433
|
+
me.recoverProp('margin-right', oldProps, oldDirty);
|
|
434
|
+
me.recoverProp('margin-bottom', oldProps, oldDirty);
|
|
435
|
+
me.recoverProp('margin-left', oldProps, oldDirty);
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Reschedules any layouts associated with a given trigger.
|
|
441
|
+
*
|
|
442
|
+
* @param {String} name The name of the trigger list ('triggers' or 'domTriggers').
|
|
443
|
+
* @param {String} propName The property name that triggers the layout (e.g., 'width').
|
|
444
|
+
* @private
|
|
445
|
+
*/
|
|
446
|
+
fireTriggers: function (name, propName) {
|
|
447
|
+
var triggers = this[name][propName],
|
|
448
|
+
context = this.context,
|
|
449
|
+
layout, layoutId;
|
|
450
|
+
|
|
451
|
+
if (triggers) {
|
|
452
|
+
for (layoutId in triggers) {
|
|
453
|
+
layout = triggers[layoutId];
|
|
454
|
+
++layout.firedTriggers;
|
|
455
|
+
if (!layout.done && !layout.blockCount && !layout.pending) {
|
|
456
|
+
context.queueLayout(layout);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Flushes any updates in the dirty collection to the DOM. This is only called if there
|
|
464
|
+
* are dirty entries because this object is only added to the flushQueue of the
|
|
465
|
+
* {@link Ext.layout.Context} when entries become dirty.
|
|
466
|
+
*/
|
|
467
|
+
flush: function () {
|
|
468
|
+
var me = this,
|
|
469
|
+
dirty = me.dirty,
|
|
470
|
+
state = me.state,
|
|
471
|
+
targetEl = me.el;
|
|
472
|
+
|
|
473
|
+
me.dirtyCount = 0;
|
|
474
|
+
|
|
475
|
+
// Flush added/removed classes
|
|
476
|
+
if (me.classList && me.classList.dirty) {
|
|
477
|
+
me.classList.flush();
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// Set any queued DOM attributes
|
|
481
|
+
if ('attributes' in me) {
|
|
482
|
+
targetEl.set(me.attributes);
|
|
483
|
+
delete me.attributes;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// Set any queued DOM HTML content
|
|
487
|
+
if ('innerHTML' in me) {
|
|
488
|
+
targetEl.innerHTML = me.innerHTML;
|
|
489
|
+
delete me.innerHTML;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
if (state.clearBoxWidth) {
|
|
493
|
+
state.clearBoxWidth = 0;
|
|
494
|
+
me.el.setStyle('width', null);
|
|
495
|
+
|
|
496
|
+
if (! --state.blocks) {
|
|
497
|
+
me.context.queueItemLayouts(me);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
if (dirty) {
|
|
502
|
+
delete me.dirty;
|
|
503
|
+
me.writeProps(dirty, true);
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
|
|
507
|
+
flushAnimations: function() {
|
|
508
|
+
var me = this,
|
|
509
|
+
animateFrom = me.lastBox,
|
|
510
|
+
target, targetAnim, duration, animateProps, anim,
|
|
511
|
+
changeCount, j, propsLen, propName, oldValue, newValue;
|
|
512
|
+
|
|
513
|
+
// Only animate if the Component has been previously layed out: first layout should not animate
|
|
514
|
+
if (animateFrom) {
|
|
515
|
+
target = me.target;
|
|
516
|
+
targetAnim = target.layout && target.layout.animate;
|
|
517
|
+
if (targetAnim) {
|
|
518
|
+
duration = Ext.isNumber(targetAnim) ? targetAnim : targetAnim.duration;
|
|
519
|
+
}
|
|
520
|
+
animateProps = Ext.Object.getKeys(me.animatePolicy);
|
|
521
|
+
|
|
522
|
+
// Create an animation block using the targetAnim configuration to provide defaults.
|
|
523
|
+
// They may want custom duration, or easing, or listeners.
|
|
524
|
+
anim = Ext.apply({}, {
|
|
525
|
+
from: {},
|
|
526
|
+
to: {},
|
|
527
|
+
duration: duration || Ext.fx.Anim.prototype.duration
|
|
528
|
+
}, targetAnim);
|
|
529
|
+
|
|
530
|
+
for (changeCount = 0, j = 0, propsLen = animateProps.length; j < propsLen; j++) {
|
|
531
|
+
propName = animateProps[j];
|
|
532
|
+
oldValue = animateFrom[propName];
|
|
533
|
+
newValue = me.peek(propName);
|
|
534
|
+
if (oldValue != newValue) {
|
|
535
|
+
propName = me.translateProps[propName]||propName;
|
|
536
|
+
anim.from[propName] = oldValue;
|
|
537
|
+
anim.to[propName] = newValue;
|
|
538
|
+
++changeCount;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// If any values have changed, kick off animation from the cached old values to the new values
|
|
543
|
+
if (changeCount) {
|
|
544
|
+
// It'a Panel being collapsed. rollback, and then fix the class name string
|
|
545
|
+
if (me.isCollapsingOrExpanding === 1) {
|
|
546
|
+
target.componentLayout.undoLayout(me);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
// Otherwise, undo just the animated properties so the animation can proceed from the old layout.
|
|
550
|
+
else {
|
|
551
|
+
me.writeProps(anim.from);
|
|
552
|
+
}
|
|
553
|
+
me.el.animate(anim);
|
|
554
|
+
|
|
555
|
+
Ext.fx.Manager.getFxQueue(me.el.id)[0].on({
|
|
556
|
+
afteranimate: function() {
|
|
557
|
+
if (me.isCollapsingOrExpanding === 1) {
|
|
558
|
+
target.componentLayout.redoLayout(me);
|
|
559
|
+
target.afterCollapse(true);
|
|
560
|
+
} else if (me.isCollapsingOrExpanding === 2) {
|
|
561
|
+
target.afterExpand(true);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Gets the border information for the element as an object with left, top, right and
|
|
571
|
+
* bottom properties holding border size in pixels. This object is only read from the
|
|
572
|
+
* DOM on first request and is cached.
|
|
573
|
+
* @return {Object}
|
|
574
|
+
*/
|
|
575
|
+
getBorderInfo: function () {
|
|
576
|
+
var me = this,
|
|
577
|
+
info = me.borderInfo;
|
|
578
|
+
|
|
579
|
+
if (!info) {
|
|
580
|
+
me.borderInfo = info = me.checkCache('borderInfo');
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
return info;
|
|
584
|
+
},
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Returns a ClassList-like object to buffer access to this item's element's classes.
|
|
588
|
+
*/
|
|
589
|
+
getClassList: function () {
|
|
590
|
+
return this.classList || (this.classList = new Ext.layout.ClassList(this));
|
|
591
|
+
},
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Returns the context item for an owned element. This should only be called on a
|
|
595
|
+
* component's item. The list of child items is used to manage invalidating calculated
|
|
596
|
+
* results.
|
|
597
|
+
*/
|
|
598
|
+
getEl: function (nameOrEl, owner) {
|
|
599
|
+
var me = this,
|
|
600
|
+
src, el, elContext;
|
|
601
|
+
|
|
602
|
+
if (nameOrEl) {
|
|
603
|
+
if (nameOrEl.dom) {
|
|
604
|
+
el = nameOrEl;
|
|
605
|
+
} else {
|
|
606
|
+
src = me.target;
|
|
607
|
+
if (owner) {
|
|
608
|
+
src = owner;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
el = src[nameOrEl];
|
|
612
|
+
if (typeof el == 'function') { // ex 'getTarget'
|
|
613
|
+
el = el.call(src);
|
|
614
|
+
if (el === me.el) {
|
|
615
|
+
return this; // comp.getTarget() often returns comp.el
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
if (el) {
|
|
621
|
+
elContext = me.context.getEl(me, el);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
return elContext || null;
|
|
626
|
+
},
|
|
627
|
+
|
|
628
|
+
getFraming: function () {
|
|
629
|
+
var me = this;
|
|
630
|
+
if (!me.framingInfo) {
|
|
631
|
+
me.framingInfo = me.target.frameSize || me.noFraming;
|
|
632
|
+
}
|
|
633
|
+
return me.framingInfo;
|
|
634
|
+
},
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Gets the "frame" information for the element as an object with left, top, right and
|
|
638
|
+
* bottom properties holding border+framing size in pixels. This object is calculated
|
|
639
|
+
* on first request and is cached.
|
|
640
|
+
* @return {Object}
|
|
641
|
+
*/
|
|
642
|
+
getFrameInfo: function () {
|
|
643
|
+
var me = this,
|
|
644
|
+
info = me.frameInfo,
|
|
645
|
+
frame, border;
|
|
646
|
+
|
|
647
|
+
if (!info) {
|
|
648
|
+
frame = me.getFraming();
|
|
649
|
+
border = me.getBorderInfo();
|
|
650
|
+
|
|
651
|
+
me.frameInfo = info = {
|
|
652
|
+
top : frame.top + border.top,
|
|
653
|
+
right : frame.right + border.right,
|
|
654
|
+
bottom: frame.bottom + border.bottom,
|
|
655
|
+
left : frame.left + border.left,
|
|
656
|
+
width : frame.width + border.width,
|
|
657
|
+
height: frame.height + border.height
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
return info;
|
|
662
|
+
},
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Gets the margin information for the element as an object with left, top, right and
|
|
666
|
+
* bottom properties holding margin size in pixels. This object is only read from the
|
|
667
|
+
* DOM on first request and is cached.
|
|
668
|
+
* @return {Object}
|
|
669
|
+
*/
|
|
670
|
+
getMarginInfo: function () {
|
|
671
|
+
var me = this,
|
|
672
|
+
info = me.marginInfo,
|
|
673
|
+
comp, manageMargins, margins, ownerLayout, ownerLayoutId;
|
|
674
|
+
|
|
675
|
+
if (!info) {
|
|
676
|
+
if (!me.wrapsComponent) {
|
|
677
|
+
info = me.checkCache('marginInfo');
|
|
678
|
+
} else {
|
|
679
|
+
comp = me.target;
|
|
680
|
+
ownerLayout = comp.ownerLayout;
|
|
681
|
+
ownerLayoutId = ownerLayout ? ownerLayout.id : null;
|
|
682
|
+
manageMargins = ownerLayout && ownerLayout.manageMargins;
|
|
683
|
+
|
|
684
|
+
// Option #1 for configuring margins on components is the "margin" config
|
|
685
|
+
// property. When supplied, this config is written to the DOM during the
|
|
686
|
+
// render process (see AbstractComponent#initStyles).
|
|
687
|
+
//
|
|
688
|
+
// Option #2 is available to some layouts (e.g., Box, Border, Fit) that
|
|
689
|
+
// handle margin calculations themselves. These layouts support a "margins"
|
|
690
|
+
// config property on their items and they have a "defaultMargins" config
|
|
691
|
+
// property. These margin values are added to the "natural" margins read
|
|
692
|
+
// from the DOM and 0's are written to the DOM after they are added.
|
|
693
|
+
|
|
694
|
+
// To avoid having to do all this on every layout, we cache the results on
|
|
695
|
+
// the component in the (private) "margin$" property. We identify the cache
|
|
696
|
+
// results as belonging to the appropriate ownerLayout in case items are
|
|
697
|
+
// moved around.
|
|
698
|
+
|
|
699
|
+
info = comp.margin$;
|
|
700
|
+
if (info && info.ownerId !== ownerLayoutId) {
|
|
701
|
+
// got one but from the wrong owner
|
|
702
|
+
info = null;
|
|
703
|
+
|
|
704
|
+
// if (manageMargins) {
|
|
705
|
+
// TODO: clear inline margins (the 0's we wrote last time)???
|
|
706
|
+
// }
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
if (!info) { // if (no cache)
|
|
710
|
+
// CSS margins are only checked if there isn't a margin property on the component
|
|
711
|
+
info = me.parseMargins(comp.margin) || me.checkCache('marginInfo');
|
|
712
|
+
|
|
713
|
+
// Some layouts also support margins and defaultMargins, e.g. Fit, Border, Box
|
|
714
|
+
if (manageMargins) {
|
|
715
|
+
margins = me.parseMargins(comp.margins, ownerLayout.defaultMargins);
|
|
716
|
+
|
|
717
|
+
if (margins) { // if (using 'margins' and/or 'defaultMargins')
|
|
718
|
+
// margin and margins can both be present at the same time and must be combined
|
|
719
|
+
info = {
|
|
720
|
+
top: info.top + margins.top,
|
|
721
|
+
right: info.right + margins.right,
|
|
722
|
+
bottom: info.bottom + margins.bottom,
|
|
723
|
+
left: info.left + margins.left
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
me.setProp('margin-top', 0);
|
|
728
|
+
me.setProp('margin-right', 0);
|
|
729
|
+
me.setProp('margin-bottom', 0);
|
|
730
|
+
me.setProp('margin-left', 0);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
// cache the layout margins and tag them with the layout id:
|
|
734
|
+
info.ownerId = ownerLayoutId;
|
|
735
|
+
comp.margin$ = info;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
info.width = info.left + info.right;
|
|
739
|
+
info.height = info.top + info.bottom;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
me.marginInfo = info;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
return info;
|
|
746
|
+
},
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* clears the margin cache so that marginInfo get re-read from the dom on the next call to getMarginInfo()
|
|
750
|
+
* This is needed in some special cases where the margins have changed since the last layout, making the cached
|
|
751
|
+
* values invalid. For example collapsed window headers have different margin than expanded ones.
|
|
752
|
+
*/
|
|
753
|
+
clearMarginCache: function() {
|
|
754
|
+
delete this.marginInfo;
|
|
755
|
+
delete this.target.margin$;
|
|
756
|
+
},
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Gets the padding information for the element as an object with left, top, right and
|
|
760
|
+
* bottom properties holding padding size in pixels. This object is only read from the
|
|
761
|
+
* DOM on first request and is cached.
|
|
762
|
+
* @return {Object}
|
|
763
|
+
*/
|
|
764
|
+
getPaddingInfo: function () {
|
|
765
|
+
var me = this,
|
|
766
|
+
info = me.paddingInfo;
|
|
767
|
+
|
|
768
|
+
if (!info) {
|
|
769
|
+
me.paddingInfo = info = me.checkCache('paddingInfo');
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
return info;
|
|
773
|
+
},
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Gets a property of this object. Also tracks the current layout as dependent on this
|
|
777
|
+
* property so that changes to it will trigger the layout to be recalculated.
|
|
778
|
+
* @param {String} propName The property name that blocked the layout (e.g., 'width').
|
|
779
|
+
* @return {Object} The property value or undefined if not yet set.
|
|
780
|
+
*/
|
|
781
|
+
getProp: function (propName) {
|
|
782
|
+
var me = this,
|
|
783
|
+
result = me.props[propName];
|
|
784
|
+
|
|
785
|
+
me.addTrigger(propName);
|
|
786
|
+
return result;
|
|
787
|
+
},
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Gets a property of this object if it is correct in the DOM. Also tracks the current
|
|
791
|
+
* layout as dependent on this property so that DOM writes of it will trigger the
|
|
792
|
+
* layout to be recalculated.
|
|
793
|
+
* @param {String} propName The property name (e.g., 'width').
|
|
794
|
+
* @return {Object} The property value or undefined if not yet set or is dirty.
|
|
795
|
+
*/
|
|
796
|
+
getDomProp: function (propName) {
|
|
797
|
+
var me = this,
|
|
798
|
+
result = (me.dirty && (propName in me.dirty)) ? undefined : me.props[propName];
|
|
799
|
+
|
|
800
|
+
me.addTrigger(propName, true);
|
|
801
|
+
return result;
|
|
802
|
+
},
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Returns a style for this item. Each style is read from the DOM only once on first
|
|
806
|
+
* request and is then cached. If the value is an integer, it is parsed automatically
|
|
807
|
+
* (so '5px' is not returned, but rather 5).
|
|
808
|
+
*
|
|
809
|
+
* @param {String} styleName The CSS style name.
|
|
810
|
+
* @return {Object} The value of the DOM style (parsed as necessary).
|
|
811
|
+
*/
|
|
812
|
+
getStyle: function (styleName) {
|
|
813
|
+
var me = this,
|
|
814
|
+
styles = me.styles,
|
|
815
|
+
info, value;
|
|
816
|
+
|
|
817
|
+
if (styleName in styles) {
|
|
818
|
+
value = styles[styleName];
|
|
819
|
+
} else {
|
|
820
|
+
info = me.styleInfo[styleName];
|
|
821
|
+
value = me.el.getStyle(styleName);
|
|
822
|
+
|
|
823
|
+
if (info && info.parseInt) {
|
|
824
|
+
value = parseInt(value, 10) || 0;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
styles[styleName] = value;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
return value;
|
|
831
|
+
},
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Returns styles for this item. Each style is read from the DOM only once on first
|
|
835
|
+
* request and is then cached. If the value is an integer, it is parsed automatically
|
|
836
|
+
* (so '5px' is not returned, but rather 5).
|
|
837
|
+
*
|
|
838
|
+
* @param {String[]} styleNames The CSS style names.
|
|
839
|
+
* @param {String[]} [altNames] The alternate names for the returned styles. If given,
|
|
840
|
+
* these names must correspond one-for-one to the {@link #styleNames}.
|
|
841
|
+
* @return {Object} The values of the DOM styles (parsed as necessary).
|
|
842
|
+
*/
|
|
843
|
+
getStyles: function (styleNames, altNames) {
|
|
844
|
+
var me = this,
|
|
845
|
+
styleCache = me.styles,
|
|
846
|
+
values = {},
|
|
847
|
+
hits = 0,
|
|
848
|
+
n = styleNames.length,
|
|
849
|
+
i, missing, missingAltNames, name, info, styleInfo, styles, value;
|
|
850
|
+
|
|
851
|
+
altNames = altNames || styleNames;
|
|
852
|
+
|
|
853
|
+
// We are optimizing this for all hits or all misses. If we hit on all styles, we
|
|
854
|
+
// don't create a missing[]. If we miss on all styles, we also don't create one.
|
|
855
|
+
for (i = 0; i < n; ++i) {
|
|
856
|
+
name = styleNames[i];
|
|
857
|
+
|
|
858
|
+
if (name in styleCache) {
|
|
859
|
+
values[altNames[i]] = styleCache[name];
|
|
860
|
+
++hits;
|
|
861
|
+
|
|
862
|
+
if (i && hits==1) { // if (first hit was after some misses)
|
|
863
|
+
missing = styleNames.slice(0, i);
|
|
864
|
+
missingAltNames = altNames.slice(0, i);
|
|
865
|
+
}
|
|
866
|
+
} else if (hits) {
|
|
867
|
+
(missing || (missing = [])).push(name);
|
|
868
|
+
(missingAltNames || (missingAltNames = [])).push(altNames[i]);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
if (hits < n) {
|
|
873
|
+
missing = missing || styleNames;
|
|
874
|
+
missingAltNames = missingAltNames || altNames;
|
|
875
|
+
styleInfo = me.styleInfo;
|
|
876
|
+
|
|
877
|
+
styles = me.el.getStyle(missing);
|
|
878
|
+
|
|
879
|
+
for (i = missing.length; i--; ) {
|
|
880
|
+
name = missing[i];
|
|
881
|
+
info = styleInfo[name];
|
|
882
|
+
value = styles[name];
|
|
883
|
+
|
|
884
|
+
if (info && info.parseInt) {
|
|
885
|
+
value = parseInt(value, 10) || 0;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
values[missingAltNames[i]] = value;
|
|
889
|
+
styleCache[name] = value;
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
return values;
|
|
894
|
+
},
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* Returns true if the given property has been set. This is equivalent to calling
|
|
898
|
+
* {@link #getProp} and not getting an undefined result. In particular, this call
|
|
899
|
+
* registers the current layout to be triggered by changes to this property.
|
|
900
|
+
*
|
|
901
|
+
* @param {String} propName The property name (e.g., 'width').
|
|
902
|
+
* @return {Boolean}
|
|
903
|
+
*/
|
|
904
|
+
hasProp: function (propName) {
|
|
905
|
+
var value = this.getProp(propName);
|
|
906
|
+
return typeof value != 'undefined';
|
|
907
|
+
},
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* Returns true if the given property is correct in the DOM. This is equivalent to
|
|
911
|
+
* calling {@link #getDomProp} and not getting an undefined result. In particular,
|
|
912
|
+
* this call registers the current layout to be triggered by flushes of this property.
|
|
913
|
+
*
|
|
914
|
+
* @param {String} propName The property name (e.g., 'width').
|
|
915
|
+
* @return {Boolean}
|
|
916
|
+
*/
|
|
917
|
+
hasDomProp: function (propName) {
|
|
918
|
+
var value = this.getDomProp(propName);
|
|
919
|
+
return typeof value != 'undefined';
|
|
920
|
+
},
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Invalidates the component associated with this item. The layouts for this component
|
|
924
|
+
* and all of its contained items will be re-run after first clearing any computed
|
|
925
|
+
* values.
|
|
926
|
+
*
|
|
927
|
+
* If state needs to be carried forward beyond the invalidation, the `options` parameter
|
|
928
|
+
* can be used.
|
|
929
|
+
*
|
|
930
|
+
* @param {Object} options An object describing how to handle the invalidation.
|
|
931
|
+
* @param {Object} options.state An object to {@link Ext#apply} to the {@link #state}
|
|
932
|
+
* of this item after invalidation clears all other properties.
|
|
933
|
+
* @param {Function} options.before A function to call after the context data is cleared
|
|
934
|
+
* and before the {@link Ext.layout.Layout#beginLayoutCycle} methods are called.
|
|
935
|
+
* @param {Ext.layout.ContextItem} options.before.item This ContextItem.
|
|
936
|
+
* @param {Object} options.before.options The options object passed to {@link #invalidate}.
|
|
937
|
+
* @param {Function} options.after A function to call after the context data is cleared
|
|
938
|
+
* and after the {@link Ext.layout.Layout#beginLayoutCycle} methods are called.
|
|
939
|
+
* @param {Ext.layout.ContextItem} options.after.item This ContextItem.
|
|
940
|
+
* @param {Object} options.after.options The options object passed to {@link #invalidate}.
|
|
941
|
+
* @param {Object} options.scope The scope to use when calling the callback functions.
|
|
942
|
+
*/
|
|
943
|
+
invalidate: function (options) {
|
|
944
|
+
this.invalid = true;
|
|
945
|
+
this.context.queueInvalidate(this, options);
|
|
946
|
+
},
|
|
947
|
+
|
|
948
|
+
markDirty: function () {
|
|
949
|
+
if (++this.dirtyCount == 1) {
|
|
950
|
+
// our first dirty property... queue us for flush
|
|
951
|
+
this.context.queueFlush(this);
|
|
952
|
+
}
|
|
953
|
+
},
|
|
954
|
+
|
|
955
|
+
onBoxMeasured: function () {
|
|
956
|
+
var boxParent = this.boxParent,
|
|
957
|
+
state = this.state;
|
|
958
|
+
|
|
959
|
+
if (boxParent && boxParent.widthModel.shrinkWrap && !state.boxMeasured && this.measuresBox) {
|
|
960
|
+
// since an autoWidth boxParent is holding a width on itself to allow each
|
|
961
|
+
// child to measure
|
|
962
|
+
state.boxMeasured = 1; // best to only call once per child
|
|
963
|
+
boxParent.boxChildMeasured();
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
|
|
967
|
+
parseMargins: function (margins, defaultMargins) {
|
|
968
|
+
if (margins === true) {
|
|
969
|
+
margins = 5;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
var type = typeof margins,
|
|
973
|
+
ret;
|
|
974
|
+
|
|
975
|
+
if (type == 'string' || type == 'number') {
|
|
976
|
+
ret = Ext.util.Format.parseBox(margins);
|
|
977
|
+
} else if (margins || defaultMargins) {
|
|
978
|
+
ret = { top: 0, right: 0, bottom: 0, left: 0 }; // base defaults
|
|
979
|
+
|
|
980
|
+
if (defaultMargins) {
|
|
981
|
+
Ext.apply(ret, this.parseMargins(defaultMargins)); // + layout defaults
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
Ext.apply(ret, margins); // + config
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
return ret;
|
|
988
|
+
},
|
|
989
|
+
|
|
990
|
+
peek: function (propName) {
|
|
991
|
+
return this.props[propName];
|
|
992
|
+
},
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* Recovers a property value from the last computation and restores its value and
|
|
996
|
+
* dirty state.
|
|
997
|
+
*
|
|
998
|
+
* @param {String} propName The name of the property to recover.
|
|
999
|
+
* @param {Object} oldProps The old "props" object from which to recover values.
|
|
1000
|
+
* @param {Object} oldDirty The old "dirty" object from which to recover state.
|
|
1001
|
+
*/
|
|
1002
|
+
recoverProp: function (propName, oldProps, oldDirty) {
|
|
1003
|
+
var me = this,
|
|
1004
|
+
props = me.props,
|
|
1005
|
+
dirty;
|
|
1006
|
+
|
|
1007
|
+
if (propName in oldProps) {
|
|
1008
|
+
props[propName] = oldProps[propName];
|
|
1009
|
+
|
|
1010
|
+
if (oldDirty && propName in oldDirty) {
|
|
1011
|
+
dirty = me.dirty || (me.dirty = {});
|
|
1012
|
+
dirty[propName] = oldDirty[propName];
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
},
|
|
1016
|
+
|
|
1017
|
+
redo: function(deep) {
|
|
1018
|
+
var me = this,
|
|
1019
|
+
items, len, i;
|
|
1020
|
+
|
|
1021
|
+
me.revertProps(me.props);
|
|
1022
|
+
|
|
1023
|
+
if (deep && me.wrapsComponent) {
|
|
1024
|
+
// Rollback the state of child Components
|
|
1025
|
+
if (me.childItems) {
|
|
1026
|
+
for (i = 0, items = me.childItems, len = items.length; i < len; i++) {
|
|
1027
|
+
items[i].redo(deep);
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
// Rollback the state of child Elements
|
|
1032
|
+
for (i = 0, items = me.children, len = items.length; i < len; i++) {
|
|
1033
|
+
items[i].redo();
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
},
|
|
1037
|
+
|
|
1038
|
+
revertProps: function (props) {
|
|
1039
|
+
var name,
|
|
1040
|
+
flushed = this.flushedProps,
|
|
1041
|
+
reverted = {};
|
|
1042
|
+
|
|
1043
|
+
for (name in props) {
|
|
1044
|
+
if (flushed.hasOwnProperty(name)) {
|
|
1045
|
+
reverted[name] = props[name];
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
this.writeProps(reverted);
|
|
1050
|
+
},
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* Queue the setting of a DOM attribute on this ContextItem's target when next flushed.
|
|
1054
|
+
*/
|
|
1055
|
+
setAttribute: function(name, value) {
|
|
1056
|
+
var me = this;
|
|
1057
|
+
if (!me.attributes) {
|
|
1058
|
+
me.attributes = {};
|
|
1059
|
+
}
|
|
1060
|
+
me.attributes[name] = value;
|
|
1061
|
+
me.markDirty();
|
|
1062
|
+
},
|
|
1063
|
+
|
|
1064
|
+
setBox: function (box) {
|
|
1065
|
+
var me = this;
|
|
1066
|
+
|
|
1067
|
+
if ('left' in box) {
|
|
1068
|
+
me.setProp('x', box.left);
|
|
1069
|
+
}
|
|
1070
|
+
if ('top' in box) {
|
|
1071
|
+
me.setProp('y', box.top);
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
// if sizeModel says we should not be setting these, the appropriate calls will be
|
|
1075
|
+
// null operations... otherwise, we must set these values, so what we have in box
|
|
1076
|
+
// is what we go with (undefined, NaN and no change are handled at a lower level):
|
|
1077
|
+
me.setSize(box.width, box.height);
|
|
1078
|
+
},
|
|
1079
|
+
|
|
1080
|
+
/**
|
|
1081
|
+
* Sets the contentHeight property. If the component uses raw content, then only the
|
|
1082
|
+
* measured height is acceptable.
|
|
1083
|
+
*
|
|
1084
|
+
* Calculated values can sometimes be NaN or undefined, which generally mean the
|
|
1085
|
+
* calculation is not done. To indicate that such as value was passed, 0 is returned.
|
|
1086
|
+
* Otherwise, 1 is returned.
|
|
1087
|
+
*
|
|
1088
|
+
* If the caller is not measuring (i.e., they are calculating) and the component has raw
|
|
1089
|
+
* content, 1 is returned indicating that the caller is done.
|
|
1090
|
+
*/
|
|
1091
|
+
setContentHeight: function (height, measured) {
|
|
1092
|
+
if (!measured && this.hasRawContent) {
|
|
1093
|
+
return 1;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
return this.setProp('contentHeight', height);
|
|
1097
|
+
},
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* Sets the contentWidth property. If the component uses raw content, then only the
|
|
1101
|
+
* measured width is acceptable.
|
|
1102
|
+
*
|
|
1103
|
+
* Calculated values can sometimes be NaN or undefined, which generally means that the
|
|
1104
|
+
* calculation is not done. To indicate that such as value was passed, 0 is returned.
|
|
1105
|
+
* Otherwise, 1 is returned.
|
|
1106
|
+
*
|
|
1107
|
+
* If the caller is not measuring (i.e., they are calculating) and the component has raw
|
|
1108
|
+
* content, 1 is returned indicating that the caller is done.
|
|
1109
|
+
*/
|
|
1110
|
+
setContentWidth: function (width, measured) {
|
|
1111
|
+
if (!measured && this.hasRawContent) {
|
|
1112
|
+
return 1;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
return this.setProp('contentWidth', width);
|
|
1116
|
+
},
|
|
1117
|
+
|
|
1118
|
+
/**
|
|
1119
|
+
* Sets the contentWidth and contentHeight properties. If the component uses raw content,
|
|
1120
|
+
* then only the measured values are acceptable.
|
|
1121
|
+
*
|
|
1122
|
+
* Calculated values can sometimes be NaN or undefined, which generally means that the
|
|
1123
|
+
* calculation is not done. To indicate that either passed value was such a value, false
|
|
1124
|
+
* returned. Otherwise, true is returned.
|
|
1125
|
+
*
|
|
1126
|
+
* If the caller is not measuring (i.e., they are calculating) and the component has raw
|
|
1127
|
+
* content, true is returned indicating that the caller is done.
|
|
1128
|
+
*/
|
|
1129
|
+
setContentSize: function (width, height, measured) {
|
|
1130
|
+
return this.setContentWidth(width, measured) +
|
|
1131
|
+
this.setContentHeight(height, measured) == 2;
|
|
1132
|
+
},
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* Sets a property value. This will unblock and/or trigger dependent layouts if the
|
|
1136
|
+
* property value is being changed. Values of NaN and undefined are not accepted by
|
|
1137
|
+
* this method.
|
|
1138
|
+
*
|
|
1139
|
+
* @param {String} propName The property name (e.g., 'width').
|
|
1140
|
+
* @param {Object} value The new value of the property.
|
|
1141
|
+
* @param {Boolean} dirty Optionally specifies if the value is currently in the DOM
|
|
1142
|
+
* (default is `true` which indicates the value is not in the DOM and must be flushed
|
|
1143
|
+
* at some point).
|
|
1144
|
+
* @return {Number} 1 if this call specified the property value, 0 if not.
|
|
1145
|
+
*/
|
|
1146
|
+
setProp: function (propName, value, dirty) {
|
|
1147
|
+
var me = this,
|
|
1148
|
+
valueType = typeof value,
|
|
1149
|
+
borderBox, info;
|
|
1150
|
+
|
|
1151
|
+
if (valueType == 'undefined' || (valueType === 'number' && isNaN(value))) {
|
|
1152
|
+
return 0;
|
|
1153
|
+
}
|
|
1154
|
+
if (me.props[propName] === value) {
|
|
1155
|
+
return 1;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
me.props[propName] = value;
|
|
1159
|
+
++me.context.progressCount;
|
|
1160
|
+
|
|
1161
|
+
if (dirty === false) {
|
|
1162
|
+
// if the prop is equivalent to what is in the DOM (we won't be writing it),
|
|
1163
|
+
// we need to clear hard blocks (domBlocks) on that property.
|
|
1164
|
+
me.fireTriggers('domTriggers', propName);
|
|
1165
|
+
me.clearBlocks('domBlocks', propName);
|
|
1166
|
+
} else {
|
|
1167
|
+
info = me.styleInfo[propName];
|
|
1168
|
+
if (info) {
|
|
1169
|
+
if (!me.dirty) {
|
|
1170
|
+
me.dirty = {};
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
if (propName == 'width' || propName == 'height') {
|
|
1174
|
+
borderBox = me.isBorderBoxValue;
|
|
1175
|
+
if (borderBox == null) {
|
|
1176
|
+
me.isBorderBoxValue = borderBox = !!me.el.isBorderBox();
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
if (!borderBox) {
|
|
1180
|
+
me.borderInfo || me.getBorderInfo();
|
|
1181
|
+
me.paddingInfo || me.getPaddingInfo();
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
me.dirty[propName] = value;
|
|
1185
|
+
me.markDirty();
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
// we always clear soft blocks on set
|
|
1190
|
+
me.fireTriggers('triggers', propName);
|
|
1191
|
+
me.clearBlocks('blocks', propName);
|
|
1192
|
+
return 1;
|
|
1193
|
+
},
|
|
1194
|
+
|
|
1195
|
+
/**
|
|
1196
|
+
* Sets the height and constrains the height to min/maxHeight range.
|
|
1197
|
+
*
|
|
1198
|
+
* @param {Number} height The height.
|
|
1199
|
+
* @param {Boolean} [dirty=true] Specifies if the value is currently in the DOM. A
|
|
1200
|
+
* value of `false` indicates that the value is already in the DOM.
|
|
1201
|
+
* @return {Number} The actual height after constraining.
|
|
1202
|
+
*/
|
|
1203
|
+
setHeight: function (height, dirty /*, private {Boolean} force */) {
|
|
1204
|
+
var me = this,
|
|
1205
|
+
comp = me.target,
|
|
1206
|
+
frameBody, frameInfo, padding;
|
|
1207
|
+
|
|
1208
|
+
if (height < 0) {
|
|
1209
|
+
height = 0;
|
|
1210
|
+
}
|
|
1211
|
+
if (!me.wrapsComponent) {
|
|
1212
|
+
if (!me.setProp('height', height, dirty)) {
|
|
1213
|
+
return NaN;
|
|
1214
|
+
}
|
|
1215
|
+
} else {
|
|
1216
|
+
height = Ext.Number.constrain(height, comp.minHeight || 0, comp.maxHeight);
|
|
1217
|
+
if (!me.setProp('height', height, dirty)) {
|
|
1218
|
+
return NaN;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
frameBody = me.frameBodyContext;
|
|
1222
|
+
if (frameBody){
|
|
1223
|
+
frameInfo = me.getFrameInfo();
|
|
1224
|
+
frameBody.setHeight(height - frameInfo.height, dirty);
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
return height;
|
|
1229
|
+
},
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* Sets the height and constrains the width to min/maxWidth range.
|
|
1233
|
+
*
|
|
1234
|
+
* @param {Number} width The width.
|
|
1235
|
+
* @param {Boolean} [dirty=true] Specifies if the value is currently in the DOM. A
|
|
1236
|
+
* value of `false` indicates that the value is already in the DOM.
|
|
1237
|
+
* @return {Number} The actual width after constraining.
|
|
1238
|
+
*/
|
|
1239
|
+
setWidth: function (width, dirty /*, private {Boolean} force */) {
|
|
1240
|
+
var me = this,
|
|
1241
|
+
comp = me.target,
|
|
1242
|
+
frameBody, frameInfo, padding;
|
|
1243
|
+
|
|
1244
|
+
if (width < 0) {
|
|
1245
|
+
width = 0;
|
|
1246
|
+
}
|
|
1247
|
+
if (!me.wrapsComponent) {
|
|
1248
|
+
if (!me.setProp('width', width, dirty)) {
|
|
1249
|
+
return NaN;
|
|
1250
|
+
}
|
|
1251
|
+
} else {
|
|
1252
|
+
width = Ext.Number.constrain(width, comp.minWidth || 0, comp.maxWidth);
|
|
1253
|
+
if (!me.setProp('width', width, dirty)) {
|
|
1254
|
+
return NaN;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
//if ((frameBody = me.target.frameBody) && (frameBody = me.getEl(frameBody))){
|
|
1258
|
+
frameBody = me.frameBodyContext;
|
|
1259
|
+
if (frameBody) {
|
|
1260
|
+
frameInfo = me.getFrameInfo();
|
|
1261
|
+
frameBody.setWidth(width - frameInfo.width, dirty);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
/*if (owner.frameMC) {
|
|
1265
|
+
frameContext = ownerContext.frameContext ||
|
|
1266
|
+
(ownerContext.frameContext = ownerContext.getEl('frameMC'));
|
|
1267
|
+
width += (frameContext.paddingInfo || frameContext.getPaddingInfo()).width;
|
|
1268
|
+
}*/
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
return width;
|
|
1272
|
+
},
|
|
1273
|
+
|
|
1274
|
+
setSize: function (width, height, dirty) {
|
|
1275
|
+
this.setWidth(width, dirty);
|
|
1276
|
+
this.setHeight(height, dirty);
|
|
1277
|
+
},
|
|
1278
|
+
|
|
1279
|
+
translateProps: {
|
|
1280
|
+
x: 'left',
|
|
1281
|
+
y: 'top'
|
|
1282
|
+
},
|
|
1283
|
+
|
|
1284
|
+
undo: function(deep) {
|
|
1285
|
+
var me = this,
|
|
1286
|
+
items, len, i;
|
|
1287
|
+
|
|
1288
|
+
me.revertProps(me.lastBox);
|
|
1289
|
+
|
|
1290
|
+
if (deep && me.wrapsComponent) {
|
|
1291
|
+
// Rollback the state of child Components
|
|
1292
|
+
if (me.childItems) {
|
|
1293
|
+
for (i = 0, items = me.childItems, len = items.length; i < len; i++) {
|
|
1294
|
+
items[i].undo(deep);
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
// Rollback the state of child Elements
|
|
1299
|
+
for (i = 0, items = me.children, len = items.length; i < len; i++) {
|
|
1300
|
+
items[i].undo();
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
},
|
|
1304
|
+
|
|
1305
|
+
unsetProp: function (propName) {
|
|
1306
|
+
var dirty = this.dirty;
|
|
1307
|
+
|
|
1308
|
+
delete this.props[propName];
|
|
1309
|
+
if (dirty) {
|
|
1310
|
+
delete dirty[propName];
|
|
1311
|
+
}
|
|
1312
|
+
},
|
|
1313
|
+
|
|
1314
|
+
writeProps: function(dirtyProps, flushing) {
|
|
1315
|
+
if (!(dirtyProps && typeof dirtyProps == 'object')) {
|
|
1316
|
+
//<debug warn>
|
|
1317
|
+
Ext.Logger.warn('writeProps expected dirtyProps to be an object');
|
|
1318
|
+
//</debug>
|
|
1319
|
+
return;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
var me = this,
|
|
1323
|
+
el = me.el,
|
|
1324
|
+
styles = {},
|
|
1325
|
+
styleCount = 0, // used as a boolean, the exact count doesn't matter
|
|
1326
|
+
styleInfo = me.styleInfo,
|
|
1327
|
+
|
|
1328
|
+
info,
|
|
1329
|
+
propName,
|
|
1330
|
+
numericValue,
|
|
1331
|
+
|
|
1332
|
+
dirtyX = 'x' in dirtyProps,
|
|
1333
|
+
dirtyY = 'y' in dirtyProps,
|
|
1334
|
+
x = dirtyProps.x,
|
|
1335
|
+
y = dirtyProps.y,
|
|
1336
|
+
|
|
1337
|
+
width = dirtyProps.width,
|
|
1338
|
+
height = dirtyProps.height,
|
|
1339
|
+
isBorderBox = me.isBorderBoxValue,
|
|
1340
|
+
target = me.target,
|
|
1341
|
+
max = Math.max,
|
|
1342
|
+
paddingWidth = 0,
|
|
1343
|
+
paddingHeight = 0;
|
|
1344
|
+
|
|
1345
|
+
// Process non-style properties:
|
|
1346
|
+
if ('displayed' in dirtyProps) {
|
|
1347
|
+
el.setDisplayed(dirtyProps.displayed);
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
// Unblock any hard blocks (domBlocks) and copy dom styles into 'styles'
|
|
1351
|
+
for (propName in dirtyProps) {
|
|
1352
|
+
if (flushing) {
|
|
1353
|
+
me.fireTriggers('domTriggers', propName);
|
|
1354
|
+
me.clearBlocks('domBlocks', propName);
|
|
1355
|
+
me.flushedProps[propName] = 1;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
info = styleInfo[propName];
|
|
1359
|
+
if (info && info.dom) {
|
|
1360
|
+
// Numeric dirty values should have their associated suffix added
|
|
1361
|
+
if (info.suffix && (numericValue = parseInt(dirtyProps[propName], 10))) {
|
|
1362
|
+
styles[propName] = numericValue + info.suffix;
|
|
1363
|
+
}
|
|
1364
|
+
// Non-numeric (eg "auto") go in unchanged.
|
|
1365
|
+
else {
|
|
1366
|
+
styles[propName] = dirtyProps[propName];
|
|
1367
|
+
}
|
|
1368
|
+
++styleCount;
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
// convert x/y into setPosition (for a component) or left/top styles (for an el)
|
|
1373
|
+
if (dirtyX || dirtyY) {
|
|
1374
|
+
if (target.isComponent) {
|
|
1375
|
+
// Ensure we always pass the current coordinate in if one coordinate has not been dirtied by a calculation cycle.
|
|
1376
|
+
target.setPosition(x||me.props.x, y||me.props.y);
|
|
1377
|
+
} else {
|
|
1378
|
+
// we wrap an element, so convert x/y to styles:
|
|
1379
|
+
if (dirtyX) {
|
|
1380
|
+
styles.left = x + 'px';
|
|
1381
|
+
++styleCount;
|
|
1382
|
+
}
|
|
1383
|
+
if (dirtyY) {
|
|
1384
|
+
styles.top = y + 'px';
|
|
1385
|
+
++styleCount;
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
// Support for the content-box box model
|
|
1391
|
+
if (!isBorderBox && (width > 0 || height > 0)) { // no need to subtract from 0
|
|
1392
|
+
// The width and height values assume the border-box box model,
|
|
1393
|
+
// so we must remove the padding & border to calculate the content-box.
|
|
1394
|
+
//<debug>
|
|
1395
|
+
if (!(me.borderInfo && me.paddingInfo)) {
|
|
1396
|
+
throw Error("Needed to have gotten the borderInfo and paddingInfo when the width or height was setProp'd");
|
|
1397
|
+
}
|
|
1398
|
+
//</debug>
|
|
1399
|
+
if(!me.frameBodyContext) {
|
|
1400
|
+
// Padding needs to be removed only if the element is not framed.
|
|
1401
|
+
paddingWidth = me.paddingInfo.width;
|
|
1402
|
+
paddingHeight = me.paddingInfo.height;
|
|
1403
|
+
}
|
|
1404
|
+
if (width) {
|
|
1405
|
+
width = max(parseInt(width, 10) - (me.borderInfo.width + paddingWidth), 0);
|
|
1406
|
+
styles.width = width + 'px';
|
|
1407
|
+
++styleCount;
|
|
1408
|
+
}
|
|
1409
|
+
if (height) {
|
|
1410
|
+
height = max(parseInt(height, 10) - (me.borderInfo.height + paddingHeight), 0);
|
|
1411
|
+
styles.height = height + 'px';
|
|
1412
|
+
++styleCount;
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
// we make only one call to setStyle to allow it to optimize itself:
|
|
1417
|
+
if (styleCount) {
|
|
1418
|
+
el.setStyle(styles);
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
}, function () {
|
|
1422
|
+
|
|
1423
|
+
var px = { dom: true, parseInt: true, suffix: 'px' },
|
|
1424
|
+
isDom = { dom: true },
|
|
1425
|
+
faux = { dom: false };
|
|
1426
|
+
|
|
1427
|
+
// If a property exists in styleInfo, it participates in some way with the DOM. It may
|
|
1428
|
+
// be virtualized (like 'x' and y') and be indirect, but still requires a flush cycle
|
|
1429
|
+
// to reach the DOM. Properties (like 'contentWidth' and 'contentHeight') have no real
|
|
1430
|
+
// presence in the DOM and hence have no flush intanglements.
|
|
1431
|
+
//
|
|
1432
|
+
// For simple styles, the object value on the right contains properties that help in
|
|
1433
|
+
// decoding values read by getStyle and preparing values to pass to setStyle.
|
|
1434
|
+
//
|
|
1435
|
+
this.prototype.styleInfo = {
|
|
1436
|
+
childrenDone: faux,
|
|
1437
|
+
componentChildrenDone: faux,
|
|
1438
|
+
containerChildrenDone: faux,
|
|
1439
|
+
containerLayoutDone: faux,
|
|
1440
|
+
displayed: faux,
|
|
1441
|
+
done: faux,
|
|
1442
|
+
x: faux,
|
|
1443
|
+
y: faux,
|
|
1444
|
+
|
|
1445
|
+
left: px,
|
|
1446
|
+
top: px,
|
|
1447
|
+
right: px,
|
|
1448
|
+
bottom: px,
|
|
1449
|
+
width: px,
|
|
1450
|
+
height: px,
|
|
1451
|
+
|
|
1452
|
+
'border-top-width': px,
|
|
1453
|
+
'border-right-width': px,
|
|
1454
|
+
'border-bottom-width': px,
|
|
1455
|
+
'border-left-width': px,
|
|
1456
|
+
|
|
1457
|
+
'margin-top': px,
|
|
1458
|
+
'margin-right': px,
|
|
1459
|
+
'margin-bottom': px,
|
|
1460
|
+
'margin-left': px,
|
|
1461
|
+
|
|
1462
|
+
'padding-top': px,
|
|
1463
|
+
'padding-right': px,
|
|
1464
|
+
'padding-bottom': px,
|
|
1465
|
+
'padding-left': px,
|
|
1466
|
+
|
|
1467
|
+
'line-height': isDom,
|
|
1468
|
+
display: isDom
|
|
1469
|
+
};
|
|
1470
|
+
});
|