extjs-rails 4.1.0.alpha5 → 4.1.0.alpha6
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/extjs-rails.js +95613 -11000
- data/lib/extjs-rails/version.rb +1 -1
- metadata +2 -509
- data/app/assets/javascripts/src/AbstractComponent.js +0 -3290
- data/app/assets/javascripts/src/AbstractManager.js +0 -144
- data/app/assets/javascripts/src/AbstractPlugin.js +0 -72
- data/app/assets/javascripts/src/Action.js +0 -276
- data/app/assets/javascripts/src/Ajax.js +0 -99
- data/app/assets/javascripts/src/Component.js +0 -1344
- data/app/assets/javascripts/src/ComponentLoader.js +0 -202
- data/app/assets/javascripts/src/ComponentManager.js +0 -47
- data/app/assets/javascripts/src/ComponentQuery.js +0 -521
- data/app/assets/javascripts/src/Editor.js +0 -494
- data/app/assets/javascripts/src/ElementLoader.js +0 -404
- data/app/assets/javascripts/src/FocusManager.js +0 -712
- data/app/assets/javascripts/src/Img.js +0 -111
- data/app/assets/javascripts/src/Layer.js +0 -543
- data/app/assets/javascripts/src/LoadMask.js +0 -432
- data/app/assets/javascripts/src/ModelManager.js +0 -186
- data/app/assets/javascripts/src/PluginManager.js +0 -110
- data/app/assets/javascripts/src/ProgressBar.js +0 -336
- data/app/assets/javascripts/src/Shadow.js +0 -233
- data/app/assets/javascripts/src/ShadowPool.js +0 -43
- data/app/assets/javascripts/src/Template.js +0 -331
- data/app/assets/javascripts/src/XTemplate.js +0 -365
- data/app/assets/javascripts/src/XTemplateCompiler.js +0 -450
- data/app/assets/javascripts/src/XTemplateParser.js +0 -249
- data/app/assets/javascripts/src/ZIndexManager.js +0 -519
- data/app/assets/javascripts/src/app/Application.js +0 -271
- data/app/assets/javascripts/src/app/Controller.js +0 -458
- data/app/assets/javascripts/src/app/EventBus.js +0 -112
- data/app/assets/javascripts/src/button/Button.js +0 -1483
- data/app/assets/javascripts/src/button/Cycle.js +0 -215
- data/app/assets/javascripts/src/button/Split.js +0 -99
- data/app/assets/javascripts/src/chart/Callout.js +0 -140
- data/app/assets/javascripts/src/chart/Chart.js +0 -966
- data/app/assets/javascripts/src/chart/Highlight.js +0 -172
- data/app/assets/javascripts/src/chart/Label.js +0 -241
- data/app/assets/javascripts/src/chart/Legend.js +0 -474
- data/app/assets/javascripts/src/chart/LegendItem.js +0 -217
- data/app/assets/javascripts/src/chart/Mask.js +0 -230
- data/app/assets/javascripts/src/chart/MaskLayer.js +0 -48
- data/app/assets/javascripts/src/chart/Navigation.js +0 -79
- data/app/assets/javascripts/src/chart/Shape.js +0 -106
- data/app/assets/javascripts/src/chart/Tip.js +0 -98
- data/app/assets/javascripts/src/chart/TipSurface.js +0 -42
- data/app/assets/javascripts/src/chart/axis/Abstract.js +0 -73
- data/app/assets/javascripts/src/chart/axis/Axis.js +0 -961
- data/app/assets/javascripts/src/chart/axis/Category.js +0 -130
- data/app/assets/javascripts/src/chart/axis/Gauge.js +0 -203
- data/app/assets/javascripts/src/chart/axis/Numeric.js +0 -235
- data/app/assets/javascripts/src/chart/axis/Radial.js +0 -204
- data/app/assets/javascripts/src/chart/axis/Time.js +0 -135
- data/app/assets/javascripts/src/chart/series/Area.js +0 -803
- data/app/assets/javascripts/src/chart/series/Bar.js +0 -853
- data/app/assets/javascripts/src/chart/series/Cartesian.js +0 -328
- data/app/assets/javascripts/src/chart/series/Column.js +0 -104
- data/app/assets/javascripts/src/chart/series/Gauge.js +0 -490
- data/app/assets/javascripts/src/chart/series/Line.js +0 -1104
- data/app/assets/javascripts/src/chart/series/Pie.js +0 -1072
- data/app/assets/javascripts/src/chart/series/Radar.js +0 -440
- data/app/assets/javascripts/src/chart/series/Scatter.js +0 -668
- data/app/assets/javascripts/src/chart/series/Series.js +0 -443
- data/app/assets/javascripts/src/chart/theme/Base.js +0 -175
- data/app/assets/javascripts/src/chart/theme/Theme.js +0 -253
- data/app/assets/javascripts/src/container/AbstractContainer.js +0 -1062
- data/app/assets/javascripts/src/container/ButtonGroup.js +0 -143
- data/app/assets/javascripts/src/container/Container.js +0 -212
- data/app/assets/javascripts/src/container/DockingContainer.js +0 -265
- data/app/assets/javascripts/src/container/Viewport.js +0 -184
- data/app/assets/javascripts/src/core/dom/Element.form.js +0 -50
- data/app/assets/javascripts/src/core/dom/Element.static-more.js +0 -159
- data/app/assets/javascripts/src/core/examples/index.html +0 -321
- data/app/assets/javascripts/src/core/examples/index.js +0 -6
- data/app/assets/javascripts/src/core/examples/src/Sample/CTO.js +0 -25
- data/app/assets/javascripts/src/core/examples/src/Sample/CoolGuy.js +0 -20
- data/app/assets/javascripts/src/core/examples/src/Sample/Developer.js +0 -43
- data/app/assets/javascripts/src/core/examples/src/Sample/Gun.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/HumanResource.js +0 -23
- data/app/assets/javascripts/src/core/examples/src/Sample/Musician.js +0 -20
- data/app/assets/javascripts/src/core/examples/src/Sample/Person.js +0 -50
- data/app/assets/javascripts/src/core/examples/src/Sample/ability/CanComposeSongs.js +0 -9
- data/app/assets/javascripts/src/core/examples/src/Sample/ability/CanPlayGuitar.js +0 -9
- data/app/assets/javascripts/src/core/examples/src/Sample/ability/CanSing.js +0 -18
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/A.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/B.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/C.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/D.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/E.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/notdeadlock/A.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/notdeadlock/B.js +0 -4
- data/app/assets/javascripts/src/core/examples/src/Sample/notdeadlock/C.js +0 -3
- data/app/assets/javascripts/src/core/src/EventManager.js +0 -1167
- data/app/assets/javascripts/src/core/src/EventObject.js +0 -883
- data/app/assets/javascripts/src/core/src/Ext-more.js +0 -1283
- data/app/assets/javascripts/src/core/src/Ext.js +0 -736
- data/app/assets/javascripts/src/core/src/Support.js +0 -662
- data/app/assets/javascripts/src/core/src/class/Base.js +0 -1085
- data/app/assets/javascripts/src/core/src/class/Class.js +0 -676
- data/app/assets/javascripts/src/core/src/class/ClassManager.js +0 -1591
- data/app/assets/javascripts/src/core/src/class/Loader.js +0 -1423
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.alignment.js +0 -173
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.insertion.js +0 -193
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.js +0 -681
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.position.js +0 -356
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.static.js +0 -474
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.style.js +0 -851
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.traversal.js +0 -180
- data/app/assets/javascripts/src/core/src/dom/AbstractHelper.js +0 -291
- data/app/assets/javascripts/src/core/src/dom/AbstractQuery.js +0 -72
- data/app/assets/javascripts/src/core/src/dom/CompositeElement.js +0 -75
- data/app/assets/javascripts/src/core/src/dom/CompositeElementLite.js +0 -436
- data/app/assets/javascripts/src/core/src/dom/DomQuery-aria.js +0 -1049
- data/app/assets/javascripts/src/core/src/env/Browser.js +0 -186
- data/app/assets/javascripts/src/core/src/env/FeatureDetector.js +0 -274
- data/app/assets/javascripts/src/core/src/env/OS.js +0 -141
- data/app/assets/javascripts/src/core/src/lang/Array.js +0 -1205
- data/app/assets/javascripts/src/core/src/lang/Date.js +0 -1463
- data/app/assets/javascripts/src/core/src/lang/Error.js +0 -326
- data/app/assets/javascripts/src/core/src/lang/Function.js +0 -485
- data/app/assets/javascripts/src/core/src/lang/Number.js +0 -175
- data/app/assets/javascripts/src/core/src/lang/Object.js +0 -606
- data/app/assets/javascripts/src/core/src/lang/String.js +0 -333
- data/app/assets/javascripts/src/core/src/misc/JSON.js +0 -236
- data/app/assets/javascripts/src/core/src/perf/Accumulator.js +0 -244
- data/app/assets/javascripts/src/core/src/perf/Monitor.js +0 -197
- data/app/assets/javascripts/src/core/src/util/DelayedTask.js +0 -71
- data/app/assets/javascripts/src/core/src/util/Event.js +0 -215
- data/app/assets/javascripts/src/core/src/util/Format.js +0 -551
- data/app/assets/javascripts/src/core/src/util/TaskManager.js +0 -417
- data/app/assets/javascripts/src/core/src/version/Version.js +0 -364
- data/app/assets/javascripts/src/core/test/unit/README.MD +0 -91
- data/app/assets/javascripts/src/core/test/unit/bootstrap.js +0 -39
- data/app/assets/javascripts/src/core/test/unit/build/build-data.js +0 -34
- data/app/assets/javascripts/src/core/test/unit/build/build.sh +0 -2
- data/app/assets/javascripts/src/core/test/unit/data.js +0 -27
- data/app/assets/javascripts/src/core/test/unit/index.html +0 -15
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom.html +0 -40
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/extjs-api.js +0 -12
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/platform-api.js +0 -134
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/sanity.js +0 -4
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/touch-api-out.js +0 -128
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/touch-api.js +0 -89
- data/app/assets/javascripts/src/core/test/unit/other_specs/env/Environment.js +0 -357
- data/app/assets/javascripts/src/core/test/unit/resources/APITest.js +0 -37
- data/app/assets/javascripts/src/core/test/unit/resources/jsb3.js +0 -14
- data/app/assets/javascripts/src/core/test/unit/resources/test-setup.js +0 -137
- data/app/assets/javascripts/src/core/test/unit/spec/EventManager.js +0 -629
- data/app/assets/javascripts/src/core/test/unit/spec/Ext-mess.backup +0 -198
- data/app/assets/javascripts/src/core/test/unit/spec/Ext-more.js +0 -520
- data/app/assets/javascripts/src/core/test/unit/spec/Ext.js +0 -1550
- data/app/assets/javascripts/src/core/test/unit/spec/Support.js +0 -250
- data/app/assets/javascripts/src/core/test/unit/spec/class/Base.js +0 -47
- data/app/assets/javascripts/src/core/test/unit/spec/class/Class.js +0 -561
- data/app/assets/javascripts/src/core/test/unit/spec/class/ClassManager.js +0 -555
- data/app/assets/javascripts/src/core/test/unit/spec/dom/CompositeElementLite.js +0 -409
- data/app/assets/javascripts/src/core/test/unit/spec/dom/DomHelper.js +0 -444
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.insertion.js +0 -342
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.js +0 -731
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.static.js +0 -201
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.style.js +0 -118
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.traversal.js +0 -336
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Array.js +0 -1229
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Date.js +0 -697
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Error.js +0 -277
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Function.js +0 -536
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Number.js +0 -323
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Object.js +0 -591
- data/app/assets/javascripts/src/core/test/unit/spec/lang/String.js +0 -451
- data/app/assets/javascripts/src/core/test/unit/spec/misc/JSON.js +0 -252
- data/app/assets/javascripts/src/core/test/unit/spec/util/Format.js +0 -521
- data/app/assets/javascripts/src/core/test/unit/spec/version/Version.js +0 -148
- data/app/assets/javascripts/src/core/test/unit/specs.html +0 -19
- data/app/assets/javascripts/src/data/AbstractStore.js +0 -887
- data/app/assets/javascripts/src/data/ArrayStore.js +0 -74
- data/app/assets/javascripts/src/data/Batch.js +0 -236
- data/app/assets/javascripts/src/data/BufferStore.js +0 -13
- data/app/assets/javascripts/src/data/Connection.js +0 -969
- data/app/assets/javascripts/src/data/DirectStore.js +0 -50
- data/app/assets/javascripts/src/data/Errors.js +0 -52
- data/app/assets/javascripts/src/data/Field.js +0 -341
- data/app/assets/javascripts/src/data/IdGenerator.js +0 -198
- data/app/assets/javascripts/src/data/JsonP.js +0 -253
- data/app/assets/javascripts/src/data/JsonPStore.js +0 -51
- data/app/assets/javascripts/src/data/JsonStore.js +0 -60
- data/app/assets/javascripts/src/data/Model.js +0 -1673
- data/app/assets/javascripts/src/data/NodeInterface.js +0 -1294
- data/app/assets/javascripts/src/data/NodeStore.js +0 -254
- data/app/assets/javascripts/src/data/Operation.js +0 -331
- data/app/assets/javascripts/src/data/Request.js +0 -40
- data/app/assets/javascripts/src/data/ResultSet.js +0 -56
- data/app/assets/javascripts/src/data/SequentialIdGenerator.js +0 -61
- data/app/assets/javascripts/src/data/SortTypes.js +0 -125
- data/app/assets/javascripts/src/data/Store.js +0 -2609
- data/app/assets/javascripts/src/data/StoreManager.js +0 -156
- data/app/assets/javascripts/src/data/Tree.js +0 -290
- data/app/assets/javascripts/src/data/TreeStore.js +0 -655
- data/app/assets/javascripts/src/data/Types.js +0 -190
- data/app/assets/javascripts/src/data/UuidGenerator.js +0 -215
- data/app/assets/javascripts/src/data/XmlStore.js +0 -76
- data/app/assets/javascripts/src/data/association/Association.js +0 -243
- data/app/assets/javascripts/src/data/association/BelongsTo.js +0 -291
- data/app/assets/javascripts/src/data/association/HasMany.js +0 -289
- data/app/assets/javascripts/src/data/association/HasOne.js +0 -304
- data/app/assets/javascripts/src/data/proxy/Ajax.js +0 -282
- data/app/assets/javascripts/src/data/proxy/Client.js +0 -21
- data/app/assets/javascripts/src/data/proxy/Direct.js +0 -181
- data/app/assets/javascripts/src/data/proxy/JsonP.js +0 -313
- data/app/assets/javascripts/src/data/proxy/LocalStorage.js +0 -69
- data/app/assets/javascripts/src/data/proxy/Memory.js +0 -156
- data/app/assets/javascripts/src/data/proxy/Proxy.js +0 -433
- data/app/assets/javascripts/src/data/proxy/Rest.js +0 -173
- data/app/assets/javascripts/src/data/proxy/Server.js +0 -460
- data/app/assets/javascripts/src/data/proxy/SessionStorage.js +0 -39
- data/app/assets/javascripts/src/data/proxy/WebStorage.js +0 -546
- data/app/assets/javascripts/src/data/reader/Array.js +0 -68
- data/app/assets/javascripts/src/data/reader/Json.js +0 -383
- data/app/assets/javascripts/src/data/reader/Reader.js +0 -735
- data/app/assets/javascripts/src/data/reader/Xml.js +0 -292
- data/app/assets/javascripts/src/data/validations.js +0 -149
- data/app/assets/javascripts/src/data/writer/Json.js +0 -81
- data/app/assets/javascripts/src/data/writer/Writer.js +0 -147
- data/app/assets/javascripts/src/data/writer/Xml.js +0 -88
- data/app/assets/javascripts/src/dd/DD.js +0 -300
- data/app/assets/javascripts/src/dd/DDProxy.js +0 -204
- data/app/assets/javascripts/src/dd/DDTarget.js +0 -171
- data/app/assets/javascripts/src/dd/DragDrop.js +0 -1101
- data/app/assets/javascripts/src/dd/DragDropManager.js +0 -1264
- data/app/assets/javascripts/src/dd/DragSource.js +0 -392
- data/app/assets/javascripts/src/dd/DragTracker.js +0 -562
- data/app/assets/javascripts/src/dd/DragZone.js +0 -137
- data/app/assets/javascripts/src/dd/DropTarget.js +0 -118
- data/app/assets/javascripts/src/dd/DropZone.js +0 -254
- data/app/assets/javascripts/src/dd/Registry.js +0 -117
- data/app/assets/javascripts/src/dd/ScrollManager.js +0 -218
- data/app/assets/javascripts/src/dd/StatusProxy.js +0 -179
- data/app/assets/javascripts/src/diag/layout/Context.js +0 -523
- data/app/assets/javascripts/src/diag/layout/ContextItem.js +0 -179
- data/app/assets/javascripts/src/direct/Event.js +0 -35
- data/app/assets/javascripts/src/direct/ExceptionEvent.js +0 -16
- data/app/assets/javascripts/src/direct/JsonProvider.js +0 -82
- data/app/assets/javascripts/src/direct/Manager.js +0 -263
- data/app/assets/javascripts/src/direct/PollingProvider.js +0 -156
- data/app/assets/javascripts/src/direct/Provider.js +0 -96
- data/app/assets/javascripts/src/direct/RemotingEvent.js +0 -24
- data/app/assets/javascripts/src/direct/RemotingMethod.js +0 -100
- data/app/assets/javascripts/src/direct/RemotingProvider.js +0 -510
- data/app/assets/javascripts/src/direct/Transaction.js +0 -41
- data/app/assets/javascripts/src/dom/Element.alignment.js +0 -378
- data/app/assets/javascripts/src/dom/Element.anim.js +0 -962
- data/app/assets/javascripts/src/dom/Element.dd.js +0 -40
- data/app/assets/javascripts/src/dom/Element.fx.js +0 -194
- data/app/assets/javascripts/src/dom/Element.js +0 -1407
- data/app/assets/javascripts/src/dom/Element.position.js +0 -501
- data/app/assets/javascripts/src/dom/Element.scroll.js +0 -214
- data/app/assets/javascripts/src/dom/Element.style.js +0 -792
- data/app/assets/javascripts/src/dom/Element.traversal.js +0 -8
- data/app/assets/javascripts/src/dom/Helper.js +0 -466
- data/app/assets/javascripts/src/dom/Query.js +0 -1067
- data/app/assets/javascripts/src/draw/Color.js +0 -303
- data/app/assets/javascripts/src/draw/Component.js +0 -245
- data/app/assets/javascripts/src/draw/CompositeSprite.js +0 -299
- data/app/assets/javascripts/src/draw/Draw.js +0 -1217
- data/app/assets/javascripts/src/draw/Matrix.js +0 -183
- data/app/assets/javascripts/src/draw/Sprite.js +0 -554
- data/app/assets/javascripts/src/draw/SpriteDD.js +0 -87
- data/app/assets/javascripts/src/draw/Surface.js +0 -1001
- data/app/assets/javascripts/src/draw/Text.js +0 -175
- data/app/assets/javascripts/src/draw/engine/ImageExporter.js +0 -106
- data/app/assets/javascripts/src/draw/engine/Svg.js +0 -734
- data/app/assets/javascripts/src/draw/engine/SvgExporter.js +0 -280
- data/app/assets/javascripts/src/draw/engine/Vml.js +0 -916
- data/app/assets/javascripts/src/flash/Component.js +0 -248
- data/app/assets/javascripts/src/form/Basic.js +0 -1018
- data/app/assets/javascripts/src/form/CheckboxGroup.js +0 -441
- data/app/assets/javascripts/src/form/CheckboxManager.js +0 -26
- data/app/assets/javascripts/src/form/FieldAncestor.js +0 -210
- data/app/assets/javascripts/src/form/FieldContainer.js +0 -290
- data/app/assets/javascripts/src/form/FieldSet.js +0 -506
- data/app/assets/javascripts/src/form/Label.js +0 -110
- data/app/assets/javascripts/src/form/Labelable.js +0 -764
- data/app/assets/javascripts/src/form/Panel.js +0 -335
- data/app/assets/javascripts/src/form/RadioGroup.js +0 -124
- data/app/assets/javascripts/src/form/RadioManager.js +0 -26
- data/app/assets/javascripts/src/form/action/Action.js +0 -307
- data/app/assets/javascripts/src/form/action/DirectLoad.js +0 -107
- data/app/assets/javascripts/src/form/action/DirectSubmit.js +0 -119
- data/app/assets/javascripts/src/form/action/Load.js +0 -120
- data/app/assets/javascripts/src/form/action/StandardSubmit.js +0 -34
- data/app/assets/javascripts/src/form/action/Submit.js +0 -257
- data/app/assets/javascripts/src/form/field/Base.js +0 -813
- data/app/assets/javascripts/src/form/field/Checkbox.js +0 -505
- data/app/assets/javascripts/src/form/field/ComboBox.js +0 -1427
- data/app/assets/javascripts/src/form/field/Date.js +0 -578
- data/app/assets/javascripts/src/form/field/Display.js +0 -155
- data/app/assets/javascripts/src/form/field/Field.js +0 -430
- data/app/assets/javascripts/src/form/field/File.js +0 -265
- data/app/assets/javascripts/src/form/field/Hidden.js +0 -75
- data/app/assets/javascripts/src/form/field/HtmlEditor.js +0 -1439
- data/app/assets/javascripts/src/form/field/Number.js +0 -380
- data/app/assets/javascripts/src/form/field/Picker.js +0 -321
- data/app/assets/javascripts/src/form/field/Radio.js +0 -279
- data/app/assets/javascripts/src/form/field/Spinner.js +0 -321
- data/app/assets/javascripts/src/form/field/Text.js +0 -727
- data/app/assets/javascripts/src/form/field/TextArea.js +0 -228
- data/app/assets/javascripts/src/form/field/Time.js +0 -459
- data/app/assets/javascripts/src/form/field/Trigger.js +0 -469
- data/app/assets/javascripts/src/form/field/VTypes.js +0 -172
- data/app/assets/javascripts/src/fx/Anim.js +0 -472
- data/app/assets/javascripts/src/fx/Animator.js +0 -410
- data/app/assets/javascripts/src/fx/CubicBezier.js +0 -77
- data/app/assets/javascripts/src/fx/Easing.js +0 -136
- data/app/assets/javascripts/src/fx/Manager.js +0 -353
- data/app/assets/javascripts/src/fx/PropertyHandler.js +0 -381
- data/app/assets/javascripts/src/fx/Queue.js +0 -123
- data/app/assets/javascripts/src/fx/target/Component.js +0 -118
- data/app/assets/javascripts/src/fx/target/CompositeElement.js +0 -46
- data/app/assets/javascripts/src/fx/target/CompositeElementCSS.js +0 -22
- data/app/assets/javascripts/src/fx/target/CompositeSprite.js +0 -34
- data/app/assets/javascripts/src/fx/target/Element.js +0 -83
- data/app/assets/javascripts/src/fx/target/ElementCSS.js +0 -77
- data/app/assets/javascripts/src/fx/target/Sprite.js +0 -128
- data/app/assets/javascripts/src/fx/target/Target.js +0 -36
- data/app/assets/javascripts/src/grid/CellEditor.js +0 -172
- data/app/assets/javascripts/src/grid/ColumnComponentLayout.js +0 -34
- data/app/assets/javascripts/src/grid/ColumnLayout.js +0 -201
- data/app/assets/javascripts/src/grid/Lockable.js +0 -863
- data/app/assets/javascripts/src/grid/LockingView.js +0 -169
- data/app/assets/javascripts/src/grid/PagingScroller.js +0 -539
- data/app/assets/javascripts/src/grid/Panel.js +0 -393
- data/app/assets/javascripts/src/grid/RowEditor.js +0 -731
- data/app/assets/javascripts/src/grid/RowNumberer.js +0 -76
- data/app/assets/javascripts/src/grid/Scroller.js +0 -5
- data/app/assets/javascripts/src/grid/View.js +0 -44
- data/app/assets/javascripts/src/grid/ViewDropZone.js +0 -41
- data/app/assets/javascripts/src/grid/column/Action.js +0 -318
- data/app/assets/javascripts/src/grid/column/Boolean.js +0 -82
- data/app/assets/javascripts/src/grid/column/Column.js +0 -835
- data/app/assets/javascripts/src/grid/column/Date.js +0 -63
- data/app/assets/javascripts/src/grid/column/Number.js +0 -52
- data/app/assets/javascripts/src/grid/column/Template.js +0 -58
- data/app/assets/javascripts/src/grid/feature/AbstractSummary.js +0 -154
- data/app/assets/javascripts/src/grid/feature/Chunking.js +0 -77
- data/app/assets/javascripts/src/grid/feature/Feature.js +0 -158
- data/app/assets/javascripts/src/grid/feature/Grouping.js +0 -822
- data/app/assets/javascripts/src/grid/feature/GroupingSummary.js +0 -243
- data/app/assets/javascripts/src/grid/feature/RowBody.js +0 -116
- data/app/assets/javascripts/src/grid/feature/RowWrap.js +0 -120
- data/app/assets/javascripts/src/grid/feature/Summary.js +0 -167
- data/app/assets/javascripts/src/grid/header/Container.js +0 -965
- data/app/assets/javascripts/src/grid/header/DragZone.js +0 -69
- data/app/assets/javascripts/src/grid/header/DropZone.js +0 -265
- data/app/assets/javascripts/src/grid/plugin/CellEditing.js +0 -453
- data/app/assets/javascripts/src/grid/plugin/DragDrop.js +0 -254
- data/app/assets/javascripts/src/grid/plugin/Editing.js +0 -561
- data/app/assets/javascripts/src/grid/plugin/HeaderReorderer.js +0 -49
- data/app/assets/javascripts/src/grid/plugin/HeaderResizer.js +0 -292
- data/app/assets/javascripts/src/grid/plugin/RowEditing.js +0 -339
- data/app/assets/javascripts/src/grid/property/Grid.js +0 -351
- data/app/assets/javascripts/src/grid/property/HeaderContainer.js +0 -109
- data/app/assets/javascripts/src/grid/property/Property.js +0 -36
- data/app/assets/javascripts/src/grid/property/Store.js +0 -141
- data/app/assets/javascripts/src/layout/ClassList.js +0 -90
- data/app/assets/javascripts/src/layout/Context.js +0 -1232
- data/app/assets/javascripts/src/layout/ContextItem.js +0 -1470
- data/app/assets/javascripts/src/layout/Layout.js +0 -761
- data/app/assets/javascripts/src/layout/component/Auto.js +0 -220
- data/app/assets/javascripts/src/layout/component/Body.js +0 -80
- data/app/assets/javascripts/src/layout/component/BoundList.js +0 -95
- data/app/assets/javascripts/src/layout/component/Button.js +0 -261
- data/app/assets/javascripts/src/layout/component/Component.js +0 -427
- data/app/assets/javascripts/src/layout/component/Dock.js +0 -1132
- data/app/assets/javascripts/src/layout/component/Draw.js +0 -79
- data/app/assets/javascripts/src/layout/component/FieldSet.js +0 -62
- data/app/assets/javascripts/src/layout/component/ProgressBar.js +0 -54
- data/app/assets/javascripts/src/layout/component/Tab.js +0 -23
- data/app/assets/javascripts/src/layout/component/field/ComboBox.js +0 -52
- data/app/assets/javascripts/src/layout/component/field/Field.js +0 -372
- data/app/assets/javascripts/src/layout/component/field/FieldContainer.js +0 -48
- data/app/assets/javascripts/src/layout/component/field/HtmlEditor.js +0 -54
- data/app/assets/javascripts/src/layout/component/field/Slider.js +0 -58
- data/app/assets/javascripts/src/layout/component/field/Text.js +0 -75
- data/app/assets/javascripts/src/layout/component/field/TextArea.js +0 -51
- data/app/assets/javascripts/src/layout/component/field/Trigger.js +0 -132
- data/app/assets/javascripts/src/layout/container/Absolute.js +0 -121
- data/app/assets/javascripts/src/layout/container/Accordion.js +0 -308
- data/app/assets/javascripts/src/layout/container/Anchor.js +0 -403
- data/app/assets/javascripts/src/layout/container/Auto.js +0 -70
- data/app/assets/javascripts/src/layout/container/Border-old-js +0 -1079
- data/app/assets/javascripts/src/layout/container/Border.js +0 -816
- data/app/assets/javascripts/src/layout/container/Box.js +0 -929
- data/app/assets/javascripts/src/layout/container/Card.js +0 -361
- data/app/assets/javascripts/src/layout/container/CheckboxGroup.js +0 -376
- data/app/assets/javascripts/src/layout/container/Column.js +0 -234
- data/app/assets/javascripts/src/layout/container/Container.js +0 -961
- data/app/assets/javascripts/src/layout/container/Editor.js +0 -74
- data/app/assets/javascripts/src/layout/container/Fit.js +0 -287
- data/app/assets/javascripts/src/layout/container/Form.js +0 -157
- data/app/assets/javascripts/src/layout/container/HBox.js +0 -134
- data/app/assets/javascripts/src/layout/container/Table.js +0 -412
- data/app/assets/javascripts/src/layout/container/VBox.js +0 -139
- data/app/assets/javascripts/src/layout/container/boxOverflow/Menu.js +0 -365
- data/app/assets/javascripts/src/layout/container/boxOverflow/None.js +0 -83
- data/app/assets/javascripts/src/layout/container/boxOverflow/Scroller.js +0 -475
- data/app/assets/javascripts/src/menu/CheckItem.js +0 -169
- data/app/assets/javascripts/src/menu/ColorPicker.js +0 -110
- data/app/assets/javascripts/src/menu/DatePicker.js +0 -100
- data/app/assets/javascripts/src/menu/Item.js +0 -553
- data/app/assets/javascripts/src/menu/KeyNav.js +0 -134
- data/app/assets/javascripts/src/menu/Manager.js +0 -219
- data/app/assets/javascripts/src/menu/Menu.js +0 -579
- data/app/assets/javascripts/src/menu/Separator.js +0 -126
- data/app/assets/javascripts/src/panel/AbstractPanel.js +0 -323
- data/app/assets/javascripts/src/panel/DD.js +0 -99
- data/app/assets/javascripts/src/panel/Header.js +0 -518
- data/app/assets/javascripts/src/panel/Panel.js +0 -2150
- data/app/assets/javascripts/src/panel/Proxy.js +0 -131
- data/app/assets/javascripts/src/panel/Table.js +0 -1018
- data/app/assets/javascripts/src/panel/Tool.js +0 -304
- data/app/assets/javascripts/src/picker/Color.js +0 -219
- data/app/assets/javascripts/src/picker/Date.js +0 -1140
- data/app/assets/javascripts/src/picker/Month.js +0 -490
- data/app/assets/javascripts/src/picker/Time.js +0 -165
- data/app/assets/javascripts/src/resizer/BorderSplitter.js +0 -22
- data/app/assets/javascripts/src/resizer/BorderSplitterTracker.js +0 -210
- data/app/assets/javascripts/src/resizer/Handle.js +0 -29
- data/app/assets/javascripts/src/resizer/ResizeTracker.js +0 -346
- data/app/assets/javascripts/src/resizer/Resizer.js +0 -477
- data/app/assets/javascripts/src/resizer/Splitter.js +0 -242
- data/app/assets/javascripts/src/resizer/SplitterTracker.js +0 -230
- data/app/assets/javascripts/src/selection/CellModel.js +0 -395
- data/app/assets/javascripts/src/selection/CheckboxModel.js +0 -234
- data/app/assets/javascripts/src/selection/DataViewModel.js +0 -160
- data/app/assets/javascripts/src/selection/Model.js +0 -646
- data/app/assets/javascripts/src/selection/RowModel.js +0 -499
- data/app/assets/javascripts/src/selection/TreeModel.js +0 -78
- data/app/assets/javascripts/src/slider/Multi.js +0 -835
- data/app/assets/javascripts/src/slider/Single.js +0 -56
- data/app/assets/javascripts/src/slider/Thumb.js +0 -259
- data/app/assets/javascripts/src/slider/Tip.js +0 -130
- data/app/assets/javascripts/src/state/CookieProvider.js +0 -120
- data/app/assets/javascripts/src/state/LocalStorageProvider.js +0 -72
- data/app/assets/javascripts/src/state/Manager.js +0 -70
- data/app/assets/javascripts/src/state/Provider.js +0 -182
- data/app/assets/javascripts/src/state/Stateful.js +0 -364
- data/app/assets/javascripts/src/tab/Bar.js +0 -258
- data/app/assets/javascripts/src/tab/Panel.js +0 -654
- data/app/assets/javascripts/src/tab/Tab.js +0 -358
- data/app/assets/javascripts/src/tail.js +0 -10
- data/app/assets/javascripts/src/tip/QuickTip.js +0 -335
- data/app/assets/javascripts/src/tip/QuickTipManager.js +0 -239
- data/app/assets/javascripts/src/tip/Tip.js +0 -160
- data/app/assets/javascripts/src/tip/ToolTip.js +0 -691
- data/app/assets/javascripts/src/toolbar/Fill.js +0 -28
- data/app/assets/javascripts/src/toolbar/Item.js +0 -16
- data/app/assets/javascripts/src/toolbar/Paging.js +0 -600
- data/app/assets/javascripts/src/toolbar/Separator.js +0 -23
- data/app/assets/javascripts/src/toolbar/Spacer.js +0 -33
- data/app/assets/javascripts/src/toolbar/TextItem.js +0 -57
- data/app/assets/javascripts/src/toolbar/Toolbar-legacy.js +0 -123
- data/app/assets/javascripts/src/toolbar/Toolbar.js +0 -447
- data/app/assets/javascripts/src/tree/Column.js +0 -90
- data/app/assets/javascripts/src/tree/Panel.js +0 -505
- data/app/assets/javascripts/src/tree/View.js +0 -658
- data/app/assets/javascripts/src/tree/ViewDragZone.js +0 -49
- data/app/assets/javascripts/src/tree/ViewDropZone.js +0 -287
- data/app/assets/javascripts/src/tree/plugin/TreeViewDragDrop.js +0 -244
- data/app/assets/javascripts/src/util/AbstractMixedCollection.js +0 -772
- data/app/assets/javascripts/src/util/Animate.js +0 -426
- data/app/assets/javascripts/src/util/Bindable.js +0 -102
- data/app/assets/javascripts/src/util/CSS.js +0 -185
- data/app/assets/javascripts/src/util/ClickRepeater.js +0 -238
- data/app/assets/javascripts/src/util/ComponentDragger.js +0 -126
- data/app/assets/javascripts/src/util/Cookies.js +0 -91
- data/app/assets/javascripts/src/util/ElementContainer.js +0 -293
- data/app/assets/javascripts/src/util/Filter.js +0 -159
- data/app/assets/javascripts/src/util/Floating.js +0 -321
- data/app/assets/javascripts/src/util/Grouper.js +0 -26
- data/app/assets/javascripts/src/util/HashMap.js +0 -356
- data/app/assets/javascripts/src/util/History.js +0 -285
- data/app/assets/javascripts/src/util/Inflector.js +0 -297
- data/app/assets/javascripts/src/util/KeyMap.js +0 -427
- data/app/assets/javascripts/src/util/KeyNav.js +0 -239
- data/app/assets/javascripts/src/util/LruCache.js +0 -257
- data/app/assets/javascripts/src/util/Memento.js +0 -131
- data/app/assets/javascripts/src/util/MixedCollection.js +0 -239
- data/app/assets/javascripts/src/util/Observable.js +0 -1003
- data/app/assets/javascripts/src/util/Offset.js +0 -60
- data/app/assets/javascripts/src/util/Point.js +0 -93
- data/app/assets/javascripts/src/util/ProtoElement.js +0 -205
- data/app/assets/javascripts/src/util/Queue.js +0 -76
- data/app/assets/javascripts/src/util/Region.js +0 -388
- data/app/assets/javascripts/src/util/Renderable.js +0 -1079
- data/app/assets/javascripts/src/util/Sortable.js +0 -248
- data/app/assets/javascripts/src/util/Sorter.js +0 -179
- data/app/assets/javascripts/src/util/TextMetrics.js +0 -148
- data/app/assets/javascripts/src/view/AbstractView.js +0 -1103
- data/app/assets/javascripts/src/view/BoundList.js +0 -207
- data/app/assets/javascripts/src/view/BoundListKeyNav.js +0 -92
- data/app/assets/javascripts/src/view/DragZone.js +0 -106
- data/app/assets/javascripts/src/view/DropZone.js +0 -240
- data/app/assets/javascripts/src/view/Table.js +0 -1229
- data/app/assets/javascripts/src/view/TableChunker.js +0 -139
- data/app/assets/javascripts/src/view/View.js +0 -636
- data/app/assets/javascripts/src/window/MessageBox.js +0 -880
- data/app/assets/javascripts/src/window/Window-legacy.js +0 -56
- data/app/assets/javascripts/src/window/Window.js +0 -793
@@ -1,427 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This class is intended to be extended or created via the {@link Ext.Component#componentLayout layout}
|
3
|
-
* configuration property. See {@link Ext.Component#componentLayout} for additional details.
|
4
|
-
* @private
|
5
|
-
*/
|
6
|
-
Ext.define('Ext.layout.component.Component', {
|
7
|
-
|
8
|
-
/* Begin Definitions */
|
9
|
-
|
10
|
-
extend: 'Ext.layout.Layout',
|
11
|
-
|
12
|
-
/* End Definitions */
|
13
|
-
|
14
|
-
type: 'component',
|
15
|
-
|
16
|
-
isComponentLayout: true,
|
17
|
-
|
18
|
-
nullBox: {},
|
19
|
-
|
20
|
-
usesContentHeight: true,
|
21
|
-
usesContentWidth: true,
|
22
|
-
usesHeight: true,
|
23
|
-
usesWidth: true,
|
24
|
-
|
25
|
-
beginLayoutCycle: function (ownerContext, firstCycle) {
|
26
|
-
var me = this,
|
27
|
-
owner = me.owner,
|
28
|
-
ownerCtContext = ownerContext.ownerCtContext,
|
29
|
-
heightModel = ownerContext.heightModel,
|
30
|
-
widthModel = ownerContext.widthModel,
|
31
|
-
body = owner.el.dom === document.body,
|
32
|
-
lastBox = owner.lastBox || me.nullBox,
|
33
|
-
lastSize = owner.el.lastBox || me.nullBox,
|
34
|
-
dirty = !body,
|
35
|
-
ownerLayout, v, widthName, heightName;
|
36
|
-
|
37
|
-
me.callParent(arguments);
|
38
|
-
|
39
|
-
if (firstCycle) {
|
40
|
-
if (me.usesContentWidth) {
|
41
|
-
++ownerContext.consumersContentWidth;
|
42
|
-
}
|
43
|
-
if (me.usesContentHeight) {
|
44
|
-
++ownerContext.consumersContentHeight;
|
45
|
-
}
|
46
|
-
if (me.usesWidth) {
|
47
|
-
++ownerContext.consumersWidth;
|
48
|
-
}
|
49
|
-
if (me.usesHeight) {
|
50
|
-
++ownerContext.consumersHeight;
|
51
|
-
}
|
52
|
-
|
53
|
-
if (ownerCtContext && !ownerCtContext.hasRawContent) {
|
54
|
-
ownerLayout = owner.ownerLayout;
|
55
|
-
|
56
|
-
if (ownerLayout.usesWidth) {
|
57
|
-
++ownerContext.consumersWidth;
|
58
|
-
}
|
59
|
-
if (ownerLayout.usesHeight) {
|
60
|
-
++ownerContext.consumersHeight;
|
61
|
-
}
|
62
|
-
}
|
63
|
-
}
|
64
|
-
|
65
|
-
// we want to publish configured dimensions as early as possible and since this is
|
66
|
-
// a write phase...
|
67
|
-
|
68
|
-
if (widthModel.configured) {
|
69
|
-
// If the owner.el is the body, owner.width is not dirty (we don't want to write
|
70
|
-
// it to the body el). For other el's, the width may already be correct in the
|
71
|
-
// DOM (e.g., it is rendered in the markup initially). If the width is not
|
72
|
-
// correct in the DOM, this is only going to be the case on the first cycle.
|
73
|
-
widthName = widthModel.names.width;
|
74
|
-
|
75
|
-
if (!body) {
|
76
|
-
dirty = firstCycle ? owner[widthName] !== lastSize.width
|
77
|
-
: widthModel.constrained;
|
78
|
-
}
|
79
|
-
|
80
|
-
ownerContext.setWidth(owner[widthName], dirty);
|
81
|
-
} else if (ownerContext.isTopLevel) {
|
82
|
-
if (widthModel.calculated) {
|
83
|
-
v = lastBox.width;
|
84
|
-
ownerContext.setWidth(v, /*dirty=*/v != lastSize.width);
|
85
|
-
}
|
86
|
-
|
87
|
-
v = lastBox.x;
|
88
|
-
ownerContext.setProp('x', v, /*dirty=*/v != lastSize.x);
|
89
|
-
}
|
90
|
-
|
91
|
-
if (heightModel.configured) {
|
92
|
-
heightName = heightModel.names.height;
|
93
|
-
|
94
|
-
if (!body) {
|
95
|
-
dirty = firstCycle ? owner[heightName] !== lastSize.height
|
96
|
-
: heightModel.constrained;
|
97
|
-
}
|
98
|
-
|
99
|
-
ownerContext.setHeight(owner[heightName], dirty);
|
100
|
-
} else if (ownerContext.isTopLevel) {
|
101
|
-
if (heightModel.calculated) {
|
102
|
-
v = lastBox.height;
|
103
|
-
ownerContext.setHeight(v, v != lastSize.height);
|
104
|
-
}
|
105
|
-
|
106
|
-
v = lastBox.y;
|
107
|
-
ownerContext.setProp('y', v, /*dirty=*/v != lastSize.y);
|
108
|
-
}
|
109
|
-
},
|
110
|
-
|
111
|
-
finishedLayout: function(ownerContext) {
|
112
|
-
var me = this,
|
113
|
-
elementChildren = ownerContext.children,
|
114
|
-
owner = me.owner,
|
115
|
-
len, i, elContext, lastBox, props, v;
|
116
|
-
|
117
|
-
// NOTE: In the code below we cannot use getProp because that will generate a layout dependency
|
118
|
-
|
119
|
-
// Set lastBox on managed child Elements.
|
120
|
-
// So that ContextItem.constructor can snag the lastBox for use by its undo method.
|
121
|
-
if (elementChildren) {
|
122
|
-
len = elementChildren.length;
|
123
|
-
for (i = 0; i < len; i++) {
|
124
|
-
elContext = elementChildren[i];
|
125
|
-
elContext.el.lastBox = elContext.props;
|
126
|
-
}
|
127
|
-
}
|
128
|
-
|
129
|
-
// Cache the size from which we are changing so that notifyOwner can notify the owningComponent with all essential information
|
130
|
-
ownerContext.previousSize = me.lastComponentSize;
|
131
|
-
|
132
|
-
// Cache the currently layed out size
|
133
|
-
me.lastComponentSize = owner.el.lastBox = props = ownerContext.props;
|
134
|
-
|
135
|
-
// lastBox is a copy of the defined props to allow save/restore of these (panel
|
136
|
-
// collapse needs this)
|
137
|
-
owner.lastBox = lastBox = {};
|
138
|
-
|
139
|
-
v = props.x;
|
140
|
-
if (v !== undefined) {
|
141
|
-
lastBox.x = v;
|
142
|
-
}
|
143
|
-
v = props.y;
|
144
|
-
if (v !== undefined) {
|
145
|
-
lastBox.y = v;
|
146
|
-
}
|
147
|
-
v = props.width;
|
148
|
-
if (v !== undefined) {
|
149
|
-
lastBox.width = v;
|
150
|
-
}
|
151
|
-
v = props.height;
|
152
|
-
if (v !== undefined) {
|
153
|
-
lastBox.height = v;
|
154
|
-
}
|
155
|
-
|
156
|
-
me.callParent(arguments);
|
157
|
-
},
|
158
|
-
|
159
|
-
notifyOwner: function(ownerContext) {
|
160
|
-
var me = this,
|
161
|
-
currentSize = me.lastComponentSize,
|
162
|
-
prevSize = ownerContext.previousSize,
|
163
|
-
args = [currentSize.width, currentSize.height];
|
164
|
-
|
165
|
-
if (prevSize) {
|
166
|
-
args.push(prevSize.width, prevSize.height);
|
167
|
-
}
|
168
|
-
|
169
|
-
// Call afterComponentLayout passing new size, and only passing old size if there *was* an old size.
|
170
|
-
me.owner.afterComponentLayout.apply(me.owner, args);
|
171
|
-
},
|
172
|
-
|
173
|
-
/**
|
174
|
-
* Returns the owner component's resize element.
|
175
|
-
* @return {Ext.Element}
|
176
|
-
*/
|
177
|
-
getTarget : function() {
|
178
|
-
return this.owner.el;
|
179
|
-
},
|
180
|
-
|
181
|
-
/**
|
182
|
-
* Returns the element into which rendering must take place. Defaults to the owner Component's encapsulating element.
|
183
|
-
*
|
184
|
-
* May be overridden in Component layout managers which implement an inner element.
|
185
|
-
* @return {Ext.Element}
|
186
|
-
*/
|
187
|
-
getRenderTarget : function() {
|
188
|
-
return this.owner.el;
|
189
|
-
},
|
190
|
-
|
191
|
-
cacheTargetInfo: function(ownerContext) {
|
192
|
-
var me = this,
|
193
|
-
targetInfo = me.targetInfo,
|
194
|
-
target;
|
195
|
-
|
196
|
-
if (!targetInfo) {
|
197
|
-
target = ownerContext.getEl('getTarget', me);
|
198
|
-
|
199
|
-
me.targetInfo = targetInfo = {
|
200
|
-
padding: target.getPaddingInfo(),
|
201
|
-
border: target.getBorderInfo()
|
202
|
-
};
|
203
|
-
}
|
204
|
-
|
205
|
-
return targetInfo;
|
206
|
-
},
|
207
|
-
|
208
|
-
measureAutoDimensions: function (ownerContext, dimensions) {
|
209
|
-
// Subtle But Important:
|
210
|
-
//
|
211
|
-
// We don't want to call getProp/hasProp et.al. unless we in fact need that value
|
212
|
-
// for our results! If we call it and don't need it, the layout manager will think
|
213
|
-
// we depend on it and will schedule us again should it change.
|
214
|
-
|
215
|
-
var me = this,
|
216
|
-
owner = me.owner,
|
217
|
-
heightModel = ownerContext.heightModel,
|
218
|
-
widthModel = ownerContext.widthModel,
|
219
|
-
boxParent = ownerContext.boxParent,
|
220
|
-
isBoxParent = ownerContext.isBoxParent,
|
221
|
-
props = ownerContext.props,
|
222
|
-
isContainer,
|
223
|
-
ret = {
|
224
|
-
gotWidth: false,
|
225
|
-
gotHeight: false,
|
226
|
-
isContainer: (isContainer = !ownerContext.hasRawContent)
|
227
|
-
},
|
228
|
-
hv = dimensions || 3,
|
229
|
-
zeroWidth, zeroHeight,
|
230
|
-
needed = 0,
|
231
|
-
got = 0,
|
232
|
-
ready, size;
|
233
|
-
|
234
|
-
// Note: this method is called *a lot*, so we have to be careful not to waste any
|
235
|
-
// time or make useless calls or, especially, read the DOM when we can avoid it.
|
236
|
-
|
237
|
-
//---------------------------------------------------------------------
|
238
|
-
// Width
|
239
|
-
|
240
|
-
if (widthModel.shrinkWrap && ownerContext.consumersContentWidth) {
|
241
|
-
++needed;
|
242
|
-
zeroWidth = !(hv & 1);
|
243
|
-
|
244
|
-
if (isContainer) {
|
245
|
-
// as a componentLayout for a container, we rely on the container layout to
|
246
|
-
// produce contentWidth...
|
247
|
-
if (zeroWidth) {
|
248
|
-
ret.contentWidth = 0;
|
249
|
-
ret.gotWidth = true;
|
250
|
-
++got;
|
251
|
-
} else if ((ret.contentWidth = ownerContext.getProp('contentWidth')) !== undefined) {
|
252
|
-
ret.gotWidth = true;
|
253
|
-
++got;
|
254
|
-
}
|
255
|
-
} else {
|
256
|
-
size = props.contentWidth;
|
257
|
-
|
258
|
-
if (typeof size == 'number') { // if (already determined)
|
259
|
-
ret.contentWidth = size;
|
260
|
-
ret.gotWidth = true;
|
261
|
-
++got;
|
262
|
-
} else {
|
263
|
-
if (zeroWidth) {
|
264
|
-
ready = true;
|
265
|
-
} else if (!ownerContext.hasDomProp('containerChildrenDone')) {
|
266
|
-
ready = false;
|
267
|
-
} else if (isBoxParent || !boxParent || boxParent.widthModel.shrinkWrap) {
|
268
|
-
// if we have no boxParent, we are ready, but a shrinkWrap boxParent
|
269
|
-
// artificially provides width early in the measurement process so
|
270
|
-
// we are ready to go in that case as well...
|
271
|
-
ready = true;
|
272
|
-
} else {
|
273
|
-
// lastly, we have a boxParent that will be given a width, so we
|
274
|
-
// can wait for that width to be set in order to properly measure
|
275
|
-
// whatever is inside...
|
276
|
-
ready = boxParent.hasDomProp('width');
|
277
|
-
}
|
278
|
-
|
279
|
-
if (ready) {
|
280
|
-
if (!isNaN(ret.contentWidth = zeroWidth ? 0 : me.measureContentWidth(ownerContext))) {
|
281
|
-
ownerContext.setContentWidth(ret.contentWidth, true);
|
282
|
-
ret.gotWidth = true;
|
283
|
-
++got;
|
284
|
-
}
|
285
|
-
}
|
286
|
-
}
|
287
|
-
}
|
288
|
-
} else if (widthModel.natural && ownerContext.consumersWidth) {
|
289
|
-
++needed;
|
290
|
-
size = props.width;
|
291
|
-
// zeroWidth does not apply
|
292
|
-
|
293
|
-
if (typeof size == 'number') { // if (already determined)
|
294
|
-
ret.width = size;
|
295
|
-
ret.gotWidth = true;
|
296
|
-
++got;
|
297
|
-
} else {
|
298
|
-
if (isBoxParent || !boxParent) {
|
299
|
-
ready = true;
|
300
|
-
} else {
|
301
|
-
// lastly, we have a boxParent that will be given a width, so we
|
302
|
-
// can wait for that width to be set in order to properly measure
|
303
|
-
// whatever is inside...
|
304
|
-
ready = boxParent.hasDomProp('width');
|
305
|
-
}
|
306
|
-
|
307
|
-
if (ready) {
|
308
|
-
if (!isNaN(ret.width = me.measureOwnerWidth(ownerContext))) {
|
309
|
-
ownerContext.setWidth(ret.width, false);
|
310
|
-
ret.gotWidth = true;
|
311
|
-
++got;
|
312
|
-
}
|
313
|
-
}
|
314
|
-
}
|
315
|
-
}
|
316
|
-
|
317
|
-
//---------------------------------------------------------------------
|
318
|
-
// Height
|
319
|
-
|
320
|
-
if (heightModel.shrinkWrap && ownerContext.consumersContentHeight) {
|
321
|
-
++needed;
|
322
|
-
zeroHeight = !(hv & 2);
|
323
|
-
|
324
|
-
if (isContainer) {
|
325
|
-
// don't ask unless we need to know...
|
326
|
-
if (zeroHeight) {
|
327
|
-
ret.contentHeight = 0;
|
328
|
-
ret.gotHeight = true;
|
329
|
-
++got;
|
330
|
-
} else if ((ret.contentHeight = ownerContext.getProp('contentHeight')) !== undefined) {
|
331
|
-
ret.gotHeight = true;
|
332
|
-
++got;
|
333
|
-
}
|
334
|
-
} else {
|
335
|
-
size = props.contentHeight;
|
336
|
-
|
337
|
-
if (typeof size == 'number') { // if (already determined)
|
338
|
-
ret.contentHeight = size;
|
339
|
-
ret.gotHeight = true;
|
340
|
-
++got;
|
341
|
-
} else {
|
342
|
-
if (zeroHeight) {
|
343
|
-
ready = true;
|
344
|
-
} else if (!ownerContext.hasDomProp('containerChildrenDone')) {
|
345
|
-
ready = false;
|
346
|
-
} else if (owner.noWrap) {
|
347
|
-
ready = true;
|
348
|
-
} else if (!widthModel.shrinkWrap) {
|
349
|
-
// fixed width, so we need the width to determine the height...
|
350
|
-
ready = (ownerContext.bodyContext || ownerContext).hasDomProp('width');// && (!ownerContext.bodyContext || ownerContext.bodyContext.hasDomProp('width'));
|
351
|
-
} else if (isBoxParent || !boxParent || boxParent.widthModel.shrinkWrap) {
|
352
|
-
// if we have no boxParent, we are ready, but an autoWidth boxParent
|
353
|
-
// artificially provides width early in the measurement process so
|
354
|
-
// we are ready to go in that case as well...
|
355
|
-
ready = true;
|
356
|
-
} else {
|
357
|
-
// lastly, we have a boxParent that will be given a width, so we
|
358
|
-
// can wait for that width to be set in order to properly measure
|
359
|
-
// whatever is inside...
|
360
|
-
ready = boxParent.hasDomProp('width');
|
361
|
-
}
|
362
|
-
|
363
|
-
if (ready) {
|
364
|
-
if (!isNaN(ret.contentHeight = zeroHeight ? 0 : me.measureContentHeight(ownerContext))) {
|
365
|
-
ownerContext.setContentHeight(ret.contentHeight, true);
|
366
|
-
ret.gotHeight = true;
|
367
|
-
++got;
|
368
|
-
}
|
369
|
-
}
|
370
|
-
}
|
371
|
-
}
|
372
|
-
} else if (heightModel.natural && ownerContext.consumersHeight) {
|
373
|
-
++needed;
|
374
|
-
size = props.height;
|
375
|
-
// zeroHeight does not apply
|
376
|
-
|
377
|
-
if (typeof size == 'number') { // if (already determined)
|
378
|
-
ret.height = size;
|
379
|
-
ret.gotHeight = true;
|
380
|
-
++got;
|
381
|
-
} else {
|
382
|
-
if (isBoxParent || !boxParent) {
|
383
|
-
ready = true;
|
384
|
-
} else {
|
385
|
-
// lastly, we have a boxParent that will be given a width, so we
|
386
|
-
// can wait for that width to be set in order to properly measure
|
387
|
-
// whatever is inside...
|
388
|
-
ready = boxParent.hasDomProp('width');
|
389
|
-
}
|
390
|
-
|
391
|
-
if (ready) {
|
392
|
-
if (!isNaN(ret.height = me.measureOwnerHeight(ownerContext))) {
|
393
|
-
ownerContext.setHeight(ret.height, false);
|
394
|
-
ret.gotHeight = true;
|
395
|
-
++got;
|
396
|
-
}
|
397
|
-
}
|
398
|
-
}
|
399
|
-
}
|
400
|
-
|
401
|
-
if (boxParent) {
|
402
|
-
ownerContext.onBoxMeasured();
|
403
|
-
}
|
404
|
-
|
405
|
-
ret.gotAll = got == needed;
|
406
|
-
// see if we can avoid calling this method by storing something on ownerContext.
|
407
|
-
return ret;
|
408
|
-
},
|
409
|
-
|
410
|
-
measureContentWidth: function (ownerContext) {
|
411
|
-
// contentWidth includes padding, but not border, framing or margins
|
412
|
-
return ownerContext.el.getWidth() - ownerContext.getFrameInfo().width;
|
413
|
-
},
|
414
|
-
|
415
|
-
measureContentHeight: function (ownerContext) {
|
416
|
-
// contentHeight includes padding, but not border, framing or margins
|
417
|
-
return ownerContext.el.getHeight() - ownerContext.getFrameInfo().height;
|
418
|
-
},
|
419
|
-
|
420
|
-
measureOwnerHeight: function (ownerContext) {
|
421
|
-
return ownerContext.el.getHeight();
|
422
|
-
},
|
423
|
-
|
424
|
-
measureOwnerWidth: function (ownerContext) {
|
425
|
-
return ownerContext.el.getWidth();
|
426
|
-
}
|
427
|
-
});
|
@@ -1,1132 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This ComponentLayout handles docking for Panels. It takes care of panels that are
|
3
|
-
* part of a ContainerLayout that sets this Panel's size and Panels that are part of
|
4
|
-
* an AutoContainerLayout in which this panel get his height based of the CSS or
|
5
|
-
* or its content.
|
6
|
-
* @private
|
7
|
-
*/
|
8
|
-
Ext.define('Ext.layout.component.Dock', {
|
9
|
-
|
10
|
-
/* Begin Definitions */
|
11
|
-
|
12
|
-
extend: 'Ext.layout.component.Component',
|
13
|
-
|
14
|
-
alias: 'layout.dock',
|
15
|
-
|
16
|
-
alternateClassName: 'Ext.layout.component.AbstractDock',
|
17
|
-
|
18
|
-
/* End Definitions */
|
19
|
-
|
20
|
-
type: 'dock',
|
21
|
-
|
22
|
-
initializedBorders: -1,
|
23
|
-
|
24
|
-
horizontalCollapsePolicy: { width: true, x: true },
|
25
|
-
|
26
|
-
verticalCollapsePolicy: { height: true, y: true },
|
27
|
-
|
28
|
-
finishRender: function () {
|
29
|
-
var me = this,
|
30
|
-
target, items;
|
31
|
-
|
32
|
-
me.callParent();
|
33
|
-
|
34
|
-
target = me.getRenderTarget();
|
35
|
-
items = me.getDockedItems();
|
36
|
-
|
37
|
-
me.finishRenderItems(target, items);
|
38
|
-
},
|
39
|
-
|
40
|
-
isItemBoxParent: function (itemContext) {
|
41
|
-
return true;
|
42
|
-
},
|
43
|
-
|
44
|
-
isItemShrinkWrap: function (item) {
|
45
|
-
return true;
|
46
|
-
},
|
47
|
-
|
48
|
-
dockOpposites: {
|
49
|
-
top: 'bottom',
|
50
|
-
right: 'left',
|
51
|
-
bottom: 'top',
|
52
|
-
left: 'right'
|
53
|
-
},
|
54
|
-
|
55
|
-
handleItemBorders: function() {
|
56
|
-
var me = this,
|
57
|
-
owner = me.owner,
|
58
|
-
borders, docked,
|
59
|
-
oldBorders = me.borders,
|
60
|
-
opposites = me.dockOpposites,
|
61
|
-
currentGeneration = owner.dockedItems.generation,
|
62
|
-
i, ln, item, dock, side,
|
63
|
-
collapsed = me.collapsed;
|
64
|
-
|
65
|
-
if (me.initializedBorders == currentGeneration || (owner.border && !owner.manageBodyBorders)) {
|
66
|
-
return;
|
67
|
-
}
|
68
|
-
|
69
|
-
me.initializedBorders = currentGeneration;
|
70
|
-
|
71
|
-
// Borders have to be calculated using expanded docked item collection.
|
72
|
-
me.collapsed = false;
|
73
|
-
docked = me.getLayoutItems();
|
74
|
-
me.collapsed = collapsed;
|
75
|
-
|
76
|
-
borders = { top: [], right: [], bottom: [], left: [] };
|
77
|
-
|
78
|
-
for (i = 0, ln = docked.length; i < ln; i++) {
|
79
|
-
item = docked[i];
|
80
|
-
dock = item.dock;
|
81
|
-
|
82
|
-
if (item.ignoreBorderManagement) {
|
83
|
-
continue;
|
84
|
-
}
|
85
|
-
|
86
|
-
if (!borders[dock].satisfied) {
|
87
|
-
borders[dock].push(item);
|
88
|
-
borders[dock].satisfied = true;
|
89
|
-
}
|
90
|
-
|
91
|
-
if (!borders.top.satisfied && opposites[dock] !== 'top') {
|
92
|
-
borders.top.push(item);
|
93
|
-
}
|
94
|
-
if (!borders.right.satisfied && opposites[dock] !== 'right') {
|
95
|
-
borders.right.push(item);
|
96
|
-
}
|
97
|
-
if (!borders.bottom.satisfied && opposites[dock] !== 'bottom') {
|
98
|
-
borders.bottom.push(item);
|
99
|
-
}
|
100
|
-
if (!borders.left.satisfied && opposites[dock] !== 'left') {
|
101
|
-
borders.left.push(item);
|
102
|
-
}
|
103
|
-
}
|
104
|
-
|
105
|
-
if (oldBorders) {
|
106
|
-
for (side in oldBorders) {
|
107
|
-
if (oldBorders.hasOwnProperty(side)) {
|
108
|
-
ln = oldBorders[side].length;
|
109
|
-
if (!owner.manageBodyBorders) {
|
110
|
-
for (i = 0; i < ln; i++) {
|
111
|
-
oldBorders[side][i].removeCls(Ext.baseCSSPrefix + 'docked-noborder-' + side);
|
112
|
-
}
|
113
|
-
if (!oldBorders[side].satisfied && !owner.bodyBorder) {
|
114
|
-
owner.removeBodyCls(Ext.baseCSSPrefix + 'docked-noborder-' + side);
|
115
|
-
}
|
116
|
-
}
|
117
|
-
else if (oldBorders[side].satisfied) {
|
118
|
-
owner.setBodyStyle('border-' + side + '-width', '');
|
119
|
-
}
|
120
|
-
}
|
121
|
-
}
|
122
|
-
}
|
123
|
-
|
124
|
-
for (side in borders) {
|
125
|
-
if (borders.hasOwnProperty(side)) {
|
126
|
-
ln = borders[side].length;
|
127
|
-
if (!owner.manageBodyBorders) {
|
128
|
-
for (i = 0; i < ln; i++) {
|
129
|
-
borders[side][i].addCls(Ext.baseCSSPrefix + 'docked-noborder-' + side);
|
130
|
-
}
|
131
|
-
if ((!borders[side].satisfied && !owner.bodyBorder) || owner.bodyBorder === false) {
|
132
|
-
owner.addBodyCls(Ext.baseCSSPrefix + 'docked-noborder-' + side);
|
133
|
-
}
|
134
|
-
}
|
135
|
-
else if (borders[side].satisfied) {
|
136
|
-
owner.setBodyStyle('border-' + side + '-width', '1px');
|
137
|
-
}
|
138
|
-
}
|
139
|
-
}
|
140
|
-
|
141
|
-
me.borders = borders;
|
142
|
-
},
|
143
|
-
|
144
|
-
beginLayout: function(ownerContext) {
|
145
|
-
var me = this,
|
146
|
-
owner = me.owner,
|
147
|
-
docked = me.getLayoutItems(),
|
148
|
-
layoutContext = ownerContext.context,
|
149
|
-
dockedItemCount = docked.length,
|
150
|
-
collapsedVert = false,
|
151
|
-
collapsedHorz = false,
|
152
|
-
dockedItems, i, item, itemContext, offsets,
|
153
|
-
collapsed;
|
154
|
-
|
155
|
-
me.callParent(arguments);
|
156
|
-
|
157
|
-
me.handleItemBorders();
|
158
|
-
|
159
|
-
// Cache the children as ContextItems (like a Container). Also setup to handle
|
160
|
-
// collapsed state:
|
161
|
-
collapsed = owner.getCollapsed();
|
162
|
-
if (Ext.isDefined(me.lastCollapsedState) && (collapsed !== me.lastCollapsedState)) {
|
163
|
-
|
164
|
-
// If we are collapsing...
|
165
|
-
if (me.owner.collapsed) {
|
166
|
-
ownerContext.isCollapsingOrExpanding = 1;
|
167
|
-
// Add the collapsed class now, so that collapsed CSS rules are applied before measurements are taken by the layout.
|
168
|
-
owner.addClsWithUI(owner.collapsedCls);
|
169
|
-
} else {
|
170
|
-
ownerContext.isCollapsingOrExpanding = 2;
|
171
|
-
// Remove the collapsed class now, before layout calculations are done.
|
172
|
-
owner.removeClsWithUI(owner.collapsedCls);
|
173
|
-
ownerContext.lastCollapsedState = me.lastCollapsedState;
|
174
|
-
}
|
175
|
-
}
|
176
|
-
me.lastCollapsedState = collapsed;
|
177
|
-
|
178
|
-
ownerContext.dockedItems = dockedItems = [];
|
179
|
-
|
180
|
-
for (i = 0; i < dockedItemCount; i++) {
|
181
|
-
item = docked[i];
|
182
|
-
itemContext = layoutContext.getCmp(item);
|
183
|
-
itemContext.dockedAt = { x: 0, y: 0 };
|
184
|
-
itemContext.offsets = offsets = Ext.Element.parseBox(item.offsets || {});
|
185
|
-
offsets.width = offsets.left + offsets.right;
|
186
|
-
offsets.height = offsets.top + offsets.bottom;
|
187
|
-
dockedItems.push(itemContext);
|
188
|
-
}
|
189
|
-
|
190
|
-
if (owner.collapsed) {
|
191
|
-
if (owner.collapsedVertical()) {
|
192
|
-
collapsedVert = true;
|
193
|
-
ownerContext.measureDimensions = 1;
|
194
|
-
} else {
|
195
|
-
collapsedHorz = true;
|
196
|
-
ownerContext.measureDimensions = 2;
|
197
|
-
}
|
198
|
-
}
|
199
|
-
|
200
|
-
ownerContext.collapsedVert = collapsedVert;
|
201
|
-
ownerContext.collapsedHorz = collapsedHorz;
|
202
|
-
|
203
|
-
ownerContext.bodyContext = ownerContext.getEl('body');
|
204
|
-
},
|
205
|
-
|
206
|
-
beginLayoutCycle: function(ownerContext) {
|
207
|
-
var me = this,
|
208
|
-
docked = ownerContext.dockedItems,
|
209
|
-
len = docked.length,
|
210
|
-
owner = me.owner,
|
211
|
-
frameBody = owner.frameBody,
|
212
|
-
lastHeightModel = me.lastHeightModel,
|
213
|
-
i, item, dock;
|
214
|
-
|
215
|
-
me.callParent(arguments);
|
216
|
-
|
217
|
-
// If we are collapsed, we want to auto-layout using the placeholder/expander
|
218
|
-
// instead of the normal items/dockedItems. This must be done here since we could
|
219
|
-
// be in a box layout w/stretchmax which sets the width/heightModel to allow it to
|
220
|
-
// control the size.
|
221
|
-
if (ownerContext.collapsedVert) {
|
222
|
-
ownerContext.heightModel = me.sizeModels.shrinkWrap;
|
223
|
-
} else if (ownerContext.collapsedHorz) {
|
224
|
-
ownerContext.widthModel = me.sizeModels.shrinkWrap;
|
225
|
-
}
|
226
|
-
|
227
|
-
if (lastHeightModel && lastHeightModel.shrinkWrap &&
|
228
|
-
!ownerContext.heightModel.shrinkWrap &&
|
229
|
-
!me.owner.manageHeight) {
|
230
|
-
owner.body.dom.style.marginBottom = '';
|
231
|
-
}
|
232
|
-
|
233
|
-
if (ownerContext.widthModel.auto) {
|
234
|
-
if (ownerContext.widthModel.shrinkWrap) {
|
235
|
-
owner.el.setWidth(null);
|
236
|
-
}
|
237
|
-
owner.body.setWidth(null);
|
238
|
-
if (frameBody) {
|
239
|
-
frameBody.setWidth(null);
|
240
|
-
}
|
241
|
-
}
|
242
|
-
if (ownerContext.heightModel.auto) {
|
243
|
-
owner.body.setHeight(null);
|
244
|
-
//owner.el.setHeight(null); Disable this for now
|
245
|
-
if (frameBody) {
|
246
|
-
frameBody.setHeight(null);
|
247
|
-
}
|
248
|
-
}
|
249
|
-
|
250
|
-
// Each time we begin (2nd+ would be due to invalidate) we need to publish the
|
251
|
-
// known contentWidth/Height if we are collapsed:
|
252
|
-
if (ownerContext.collapsedVert) {
|
253
|
-
ownerContext.setContentHeight(0);
|
254
|
-
} else if (ownerContext.collapsedHorz) {
|
255
|
-
ownerContext.setContentWidth(0);
|
256
|
-
}
|
257
|
-
|
258
|
-
// dock: 'right' items, when a panel gets narrower get "squished". Moving them to
|
259
|
-
// left:0px avoids this!
|
260
|
-
for (i = 0; i < len; i++) {
|
261
|
-
item = docked[i].target;
|
262
|
-
dock = item.dock;
|
263
|
-
|
264
|
-
if (dock == 'right') {
|
265
|
-
item.el.setLeft(0);
|
266
|
-
} else if (dock != 'left') {
|
267
|
-
continue;
|
268
|
-
}
|
269
|
-
|
270
|
-
// TODO - clear width/height?
|
271
|
-
}
|
272
|
-
},
|
273
|
-
|
274
|
-
calculate: function (ownerContext) {
|
275
|
-
var me = this,
|
276
|
-
measure = me.measureAutoDimensions(ownerContext, ownerContext.measureDimensions),
|
277
|
-
state = ownerContext.state,
|
278
|
-
horzDone = state.horzDone,
|
279
|
-
vertDone = state.vertDone,
|
280
|
-
bodyContext = ownerContext.bodyContext,
|
281
|
-
horz, vert, forward, backward;
|
282
|
-
|
283
|
-
// make sure we can use these value w/o calling methods to get them
|
284
|
-
ownerContext.borderInfo || ownerContext.getBorderInfo();
|
285
|
-
ownerContext.paddingInfo || ownerContext.getPaddingInfo();
|
286
|
-
ownerContext.framingInfo || ownerContext.getFraming();
|
287
|
-
bodyContext.borderInfo || bodyContext.getBorderInfo();
|
288
|
-
bodyContext.paddingInfo || bodyContext.getPaddingInfo();
|
289
|
-
|
290
|
-
// Start the axes so they are ready to proceed inwards (fixed-size) or outwards
|
291
|
-
// (shrinkWrap) and stash key property names as well:
|
292
|
-
horz = !horzDone &&
|
293
|
-
me.createAxis(ownerContext, measure.contentWidth, ownerContext.widthModel,
|
294
|
-
'left', 'right', 'x', 'width', 'Width', ownerContext.collapsedHorz);
|
295
|
-
vert = !vertDone &&
|
296
|
-
me.createAxis(ownerContext, measure.contentHeight, ownerContext.heightModel,
|
297
|
-
'top', 'bottom', 'y', 'height', 'Height', ownerContext.collapsedVert);
|
298
|
-
|
299
|
-
// We iterate forward and backward over the dockedItems at the same time based on
|
300
|
-
// whether an axis is shrinkWrap or fixed-size. For a fixed-size axis, the outer box
|
301
|
-
// axis is allocated to docked items in forward order and is reduced accordingly.
|
302
|
-
// To handle a shrinkWrap axis, the box starts at the inner (body) size and is used to
|
303
|
-
// size docked items in backwards order. This is because the last docked item shares
|
304
|
-
// an edge with the body. The item size is used to adjust the shrinkWrap axis outwards
|
305
|
-
// until the first docked item (at the outermost edge) is processed. This backwards
|
306
|
-
// order ensures that docked items never get an incorrect size for any dimension.
|
307
|
-
for (forward = 0, backward = ownerContext.dockedItems.length; backward--; ++forward) {
|
308
|
-
if (horz) {
|
309
|
-
me.dockChild(ownerContext, horz, backward, forward);
|
310
|
-
}
|
311
|
-
if (vert) {
|
312
|
-
me.dockChild(ownerContext, vert, backward, forward);
|
313
|
-
}
|
314
|
-
}
|
315
|
-
|
316
|
-
if (horz && me.finishAxis(ownerContext, horz)) {
|
317
|
-
state.horzDone = horzDone = horz;
|
318
|
-
}
|
319
|
-
|
320
|
-
if (vert && me.finishAxis(ownerContext, vert)) {
|
321
|
-
state.vertDone = vertDone = vert;
|
322
|
-
}
|
323
|
-
|
324
|
-
// Once all items are docked, the final size of the outer panel or inner body can
|
325
|
-
// be determined. If we can determine both width and height, we are done.
|
326
|
-
if (horzDone && vertDone && me.finishConstraints(ownerContext, horzDone, vertDone)) {
|
327
|
-
// Size information is published as we dock items but position is hard to do
|
328
|
-
// that way (while avoiding published multiple times) so we publish all the
|
329
|
-
// positions at the end.
|
330
|
-
me.finishPositions(ownerContext, horzDone, vertDone);
|
331
|
-
} else {
|
332
|
-
me.done = false;
|
333
|
-
}
|
334
|
-
},
|
335
|
-
|
336
|
-
/**
|
337
|
-
* Creates an axis object given the particulars.
|
338
|
-
* @private
|
339
|
-
*/
|
340
|
-
createAxis: function (ownerContext, contentSize, sizeModel, dockBegin, dockEnd, posProp,
|
341
|
-
sizeProp, sizePropCap, collapsedAxis) {
|
342
|
-
var begin = 0,
|
343
|
-
owner = this.owner,
|
344
|
-
maxSize = owner['max' + sizePropCap],
|
345
|
-
minSize = owner['min' + sizePropCap] || 0,
|
346
|
-
hasMaxSize = maxSize != null, // exactly the same as "maxSize !== null && maxSize !== undefined"
|
347
|
-
constrainedSize = ownerContext.state['constrained' + sizePropCap],
|
348
|
-
isConstrainedSize = constrainedSize != null,
|
349
|
-
setSize = 'set' + sizePropCap,
|
350
|
-
border, bodyContext, frameSize, padding, end;
|
351
|
-
|
352
|
-
if (sizeModel.shrinkWrap && !isConstrainedSize) {
|
353
|
-
// End position before adding docks around the content is content size plus the body borders in this axis.
|
354
|
-
// If collapsed in this axis, the body borders will not be shown.
|
355
|
-
if (collapsedAxis) {
|
356
|
-
end = 0;
|
357
|
-
} else {
|
358
|
-
bodyContext = ownerContext.bodyContext;
|
359
|
-
end = contentSize + bodyContext.borderInfo[sizeProp];
|
360
|
-
}
|
361
|
-
} else {
|
362
|
-
border = ownerContext.borderInfo;
|
363
|
-
frameSize = ownerContext.framingInfo;
|
364
|
-
padding = ownerContext.paddingInfo;
|
365
|
-
|
366
|
-
if (isConstrainedSize) {
|
367
|
-
end = constrainedSize;
|
368
|
-
sizeModel = this.sizeModels.calculated; // behave as if calculated
|
369
|
-
ownerContext[setSize](constrainedSize);
|
370
|
-
} else {
|
371
|
-
end = ownerContext.getProp(sizeProp);
|
372
|
-
}
|
373
|
-
|
374
|
-
end -= border[dockEnd] + padding[dockEnd] + frameSize[dockEnd];
|
375
|
-
begin = border[dockBegin] + padding[dockBegin] + frameSize[dockBegin];
|
376
|
-
}
|
377
|
-
|
378
|
-
return {
|
379
|
-
shrinkWrap: sizeModel.shrinkWrap,
|
380
|
-
sizeModel: sizeModel,
|
381
|
-
// An axis tracks start and end+1 px positions. eg 0 to 10 for 10px high
|
382
|
-
begin: begin,
|
383
|
-
end: end,
|
384
|
-
collapsed: collapsedAxis,
|
385
|
-
horizontal: posProp == 'x',
|
386
|
-
ignoreFrameBegin: false,
|
387
|
-
ignoreFrameEnd: false,
|
388
|
-
initialSize: end - begin,
|
389
|
-
hasMinMaxConstraints: (minSize || hasMaxSize) && sizeModel.shrinkWrap,
|
390
|
-
isConstrainedSize: isConstrainedSize,
|
391
|
-
minSize: minSize,
|
392
|
-
maxSize: hasMaxSize ? maxSize : 1e9,
|
393
|
-
bodyPosProp: this.owner.manageHeight ? posProp : ('margin-' + dockBegin), // 'margin-left' or 'margin-top'
|
394
|
-
dockBegin: dockBegin, // 'left' or 'top'
|
395
|
-
dockEnd: dockEnd, // 'right' or 'end'
|
396
|
-
posProp: posProp, // 'x' or 'y'
|
397
|
-
sizeProp: sizeProp, // 'width' or 'height'
|
398
|
-
sizePropCap: sizePropCap, // 'Width' or 'Height'
|
399
|
-
setSize: setSize,
|
400
|
-
dockedPixelsEnd: 0
|
401
|
-
};
|
402
|
-
},
|
403
|
-
|
404
|
-
/**
|
405
|
-
* Docks a child item on the specified axis. This boils down to determining if the item
|
406
|
-
* is docked at the "beginning" of the axis ("left" if horizontal, "top" if vertical),
|
407
|
-
* the "end" of the axis ("right" if horizontal, "bottom" if vertical) or stretches
|
408
|
-
* along the axis ("top" or "bottom" if horizontal, "left" or "right" if vertical). It
|
409
|
-
* also has to differentiate between fixed and shrinkWrap sized dimensions.
|
410
|
-
* @private
|
411
|
-
*/
|
412
|
-
dockChild: function (ownerContext, axis, backward, forward) {
|
413
|
-
var me = this,
|
414
|
-
itemContext = ownerContext.dockedItems[axis.shrinkWrap ? backward : forward],
|
415
|
-
item = itemContext.target,
|
416
|
-
dock = item.dock, // left/top/right/bottom
|
417
|
-
pos;
|
418
|
-
|
419
|
-
if(item.ignoreParentFrame && ownerContext.isCollapsingOrExpanding) {
|
420
|
-
// collapsed window header margins may differ from expanded window header margins
|
421
|
-
// so we need to make sure the old cached values are not used in axis calculations
|
422
|
-
itemContext.clearMarginCache();
|
423
|
-
}
|
424
|
-
|
425
|
-
if (dock == axis.dockBegin) {
|
426
|
-
if (axis.shrinkWrap) {
|
427
|
-
pos = me.dockOutwardBegin(ownerContext, itemContext, item, axis);
|
428
|
-
} else {
|
429
|
-
pos = me.dockInwardBegin(ownerContext, itemContext, item, axis);
|
430
|
-
}
|
431
|
-
} else if (dock == axis.dockEnd) {
|
432
|
-
if (axis.shrinkWrap) {
|
433
|
-
pos = me.dockOutwardEnd(ownerContext, itemContext, item, axis);
|
434
|
-
} else {
|
435
|
-
pos = me.dockInwardEnd(ownerContext, itemContext, item, axis);
|
436
|
-
}
|
437
|
-
} else {
|
438
|
-
pos = me.dockStretch(ownerContext, itemContext, item, axis);
|
439
|
-
}
|
440
|
-
|
441
|
-
itemContext.dockedAt[axis.posProp] = pos;
|
442
|
-
},
|
443
|
-
|
444
|
-
/**
|
445
|
-
* Docks an item on a fixed-size axis at the "beginning". The "beginning" of the horizontal
|
446
|
-
* axis is "left" and the vertical is "top". For a fixed-size axis, the size works from
|
447
|
-
* the outer element (the panel) towards the body.
|
448
|
-
* @private
|
449
|
-
*/
|
450
|
-
dockInwardBegin: function (ownerContext, itemContext, item, axis) {
|
451
|
-
var pos = axis.begin,
|
452
|
-
sizeProp = axis.sizeProp,
|
453
|
-
size,
|
454
|
-
dock;
|
455
|
-
|
456
|
-
if (item.ignoreParentFrame) {
|
457
|
-
dock = item.dock;
|
458
|
-
pos -= ownerContext.borderInfo[dock] + ownerContext.paddingInfo[dock] +
|
459
|
-
ownerContext.framingInfo[dock];
|
460
|
-
}
|
461
|
-
|
462
|
-
if (!item.overlay) {
|
463
|
-
size = itemContext.getProp(sizeProp) + itemContext.getMarginInfo()[sizeProp];
|
464
|
-
axis.begin += size;
|
465
|
-
}
|
466
|
-
|
467
|
-
return pos;
|
468
|
-
},
|
469
|
-
|
470
|
-
/**
|
471
|
-
* Docks an item on a fixed-size axis at the "end". The "end" of the horizontal axis is
|
472
|
-
* "right" and the vertical is "bottom".
|
473
|
-
* @private
|
474
|
-
*/
|
475
|
-
dockInwardEnd: function (ownerContext, itemContext, item, axis) {
|
476
|
-
var sizeProp = axis.sizeProp,
|
477
|
-
size = itemContext.getProp(sizeProp) + itemContext.getMarginInfo()[sizeProp],
|
478
|
-
pos = axis.end - size;
|
479
|
-
|
480
|
-
if (!item.overlay) {
|
481
|
-
axis.end = pos;
|
482
|
-
}
|
483
|
-
|
484
|
-
if (item.ignoreParentFrame) {
|
485
|
-
pos += ownerContext.borderInfo[item.dock] + ownerContext.paddingInfo[item.dock] +
|
486
|
-
ownerContext.framingInfo[item.dock];
|
487
|
-
}
|
488
|
-
|
489
|
-
return pos;
|
490
|
-
},
|
491
|
-
|
492
|
-
/**
|
493
|
-
* Docks an item on a shrinkWrap axis at the "beginning". The "beginning" of the horizontal
|
494
|
-
* axis is "left" and the vertical is "top". For a shrinkWrap axis, the size works from
|
495
|
-
* the body outward to the outermost element (the panel).
|
496
|
-
*
|
497
|
-
* During the docking process, coordinates are allowed to be negative. We start with the
|
498
|
-
* body at (0,0) so items docked "top" or "left" will simply be assigned negative x/y. In
|
499
|
-
* the {@link #finishPositions} method these are corrected and framing is added. This way
|
500
|
-
* the correction is applied as a simple translation of delta x/y on all coordinates to
|
501
|
-
* bring the origin back to (0,0).
|
502
|
-
* @private
|
503
|
-
*/
|
504
|
-
dockOutwardBegin: function (ownerContext, itemContext, item, axis) {
|
505
|
-
var pos = axis.begin,
|
506
|
-
sizeProp = axis.sizeProp,
|
507
|
-
dock, size;
|
508
|
-
|
509
|
-
if (axis.collapsed) {
|
510
|
-
axis.ignoreFrameBegin = axis.ignoreFrameEnd = true;
|
511
|
-
} else if (item.ignoreParentFrame) {
|
512
|
-
dock = item.dock;
|
513
|
-
pos -= ownerContext.borderInfo[dock] + ownerContext.paddingInfo[dock] +
|
514
|
-
ownerContext.framingInfo[dock];
|
515
|
-
|
516
|
-
axis.ignoreFrameBegin = true;
|
517
|
-
}
|
518
|
-
|
519
|
-
if (!item.overlay) {
|
520
|
-
size = itemContext.getProp(sizeProp) + itemContext.getMarginInfo()[sizeProp];
|
521
|
-
pos -= size;
|
522
|
-
axis.begin = pos;
|
523
|
-
}
|
524
|
-
|
525
|
-
return pos;
|
526
|
-
},
|
527
|
-
|
528
|
-
/**
|
529
|
-
* Docks an item on a shrinkWrap axis at the "end". The "end" of the horizontal axis is
|
530
|
-
* "right" and the vertical is "bottom".
|
531
|
-
* @private
|
532
|
-
*/
|
533
|
-
dockOutwardEnd: function (ownerContext, itemContext, item, axis) {
|
534
|
-
var pos = axis.end,
|
535
|
-
sizeProp = axis.sizeProp,
|
536
|
-
dock, size;
|
537
|
-
|
538
|
-
size = itemContext.getProp(sizeProp) + itemContext.getMarginInfo()[sizeProp];
|
539
|
-
|
540
|
-
if (axis.collapsed) {
|
541
|
-
axis.ignoreFrameBegin = axis.ignoreFrameEnd = true;
|
542
|
-
} else if (item.ignoreParentFrame) {
|
543
|
-
dock = item.dock;
|
544
|
-
pos += ownerContext.borderInfo[dock] + ownerContext.paddingInfo[dock] +
|
545
|
-
ownerContext.framingInfo[dock];
|
546
|
-
|
547
|
-
axis.ignoreFrameEnd = true;
|
548
|
-
}
|
549
|
-
|
550
|
-
if (!item.overlay) {
|
551
|
-
axis.end = pos + size;
|
552
|
-
axis.dockedPixelsEnd += size;
|
553
|
-
}
|
554
|
-
|
555
|
-
return pos;
|
556
|
-
},
|
557
|
-
|
558
|
-
/**
|
559
|
-
* Docks an item that might stretch across an axis. This is done for dock "top" and
|
560
|
-
* "bottom" items on the horizontal axis and dock "left" and "right" on the vertical.
|
561
|
-
* @private
|
562
|
-
*/
|
563
|
-
dockStretch: function (ownerContext, itemContext, item, axis) {
|
564
|
-
var dock = item.dock, // left/top/right/bottom (also used to index padding/border)
|
565
|
-
sizeProp = axis.sizeProp, // 'width' or 'height'
|
566
|
-
horizontal = dock == 'top' || dock == 'bottom',
|
567
|
-
offsets = itemContext.offsets,
|
568
|
-
border = ownerContext.borderInfo,
|
569
|
-
padding = ownerContext.paddingInfo,
|
570
|
-
endProp = horizontal ? 'right' : 'bottom',
|
571
|
-
startProp = horizontal ? 'left' : 'top',
|
572
|
-
pos = axis.begin + offsets[startProp],
|
573
|
-
margin, size, framing;
|
574
|
-
|
575
|
-
if (item.stretch !== false) {
|
576
|
-
size = axis.end - pos - offsets[endProp];
|
577
|
-
|
578
|
-
if (item.ignoreParentFrame) {
|
579
|
-
framing = ownerContext.framingInfo;
|
580
|
-
pos -= border[startProp] + padding[startProp] + framing[startProp];
|
581
|
-
size += border[sizeProp] + padding[sizeProp] + framing[sizeProp];
|
582
|
-
}
|
583
|
-
|
584
|
-
margin = itemContext.getMarginInfo();
|
585
|
-
size -= margin[sizeProp];
|
586
|
-
|
587
|
-
itemContext[axis.setSize](size);
|
588
|
-
}
|
589
|
-
|
590
|
-
return pos;
|
591
|
-
},
|
592
|
-
|
593
|
-
/**
|
594
|
-
* Finishes the calculation of an axis by determining its size. In non-shrink-wrap
|
595
|
-
* cases, this is also where we set the body size.
|
596
|
-
* @private
|
597
|
-
*/
|
598
|
-
finishAxis: function (ownerContext, axis) {
|
599
|
-
var size = axis.end - axis.begin,
|
600
|
-
setSizeMethod = axis.setSize,
|
601
|
-
beginName = axis.dockBegin, // left or top
|
602
|
-
endName = axis.dockEnd, // right or bottom
|
603
|
-
border = ownerContext.borderInfo,
|
604
|
-
padding = ownerContext.paddingInfo,
|
605
|
-
framing = ownerContext.framingInfo,
|
606
|
-
frameSize = padding[beginName] + border[beginName] + framing[beginName],
|
607
|
-
bodyContext = ownerContext.bodyContext,
|
608
|
-
bodyPos, bodySize, dirty;
|
609
|
-
|
610
|
-
if (axis.shrinkWrap) {
|
611
|
-
// Since items docked left/top on a shrinkWrap axis go into negative coordinates,
|
612
|
-
// we apply a delta to all coordinates to adjust their relative origin back to
|
613
|
-
// (0,0).
|
614
|
-
axis.delta = -axis.begin; // either 0 or a positive number
|
615
|
-
|
616
|
-
bodySize = axis.initialSize;
|
617
|
-
|
618
|
-
if (axis.ignoreFrameBegin) {
|
619
|
-
axis.delta -= border[beginName];
|
620
|
-
bodyPos = -axis.begin - frameSize;
|
621
|
-
} else {
|
622
|
-
size += frameSize;
|
623
|
-
axis.delta += padding[beginName] + framing[beginName];
|
624
|
-
bodyPos = -axis.begin;
|
625
|
-
}
|
626
|
-
|
627
|
-
if (!axis.ignoreFrameEnd) {
|
628
|
-
size += padding[endName] + border[endName] + framing[endName];
|
629
|
-
}
|
630
|
-
|
631
|
-
axis.size = size; // we have to wait for min/maxWidth/Height processing
|
632
|
-
|
633
|
-
if (!axis.horizontal && !this.owner.manageHeight) {
|
634
|
-
// the height of the bodyEl will give the proper height to the outerEl so
|
635
|
-
// we don't need to set heights in the DOM
|
636
|
-
dirty = false;
|
637
|
-
}
|
638
|
-
} else {
|
639
|
-
// For a fixed-size axis, we started at the outer box and already have the
|
640
|
-
// proper origin... almost... except for the owner's border.
|
641
|
-
axis.delta = -border[axis.dockBegin]; // 'left' or 'top'
|
642
|
-
|
643
|
-
// Body size is remaining space between ends of Axis.
|
644
|
-
bodySize = size;
|
645
|
-
bodyPos = axis.begin - frameSize;
|
646
|
-
}
|
647
|
-
|
648
|
-
bodyContext[setSizeMethod](bodySize, dirty);
|
649
|
-
bodyContext.setProp(axis.bodyPosProp, bodyPos);
|
650
|
-
|
651
|
-
return !isNaN(size);
|
652
|
-
},
|
653
|
-
|
654
|
-
/**
|
655
|
-
* Finishes processing of each axis by applying the min/max size constraints.
|
656
|
-
* @private
|
657
|
-
*/
|
658
|
-
finishConstraints: function (ownerContext, horz, vert) {
|
659
|
-
var horzTooSmall = horz.size < horz.minSize,
|
660
|
-
horzTooBig = horz.size > horz.maxSize,
|
661
|
-
vertTooSmall = vert.size < vert.minSize,
|
662
|
-
vertTooBig = vert.size > vert.maxSize,
|
663
|
-
state = ownerContext.state,
|
664
|
-
ret = true,
|
665
|
-
configured = this.sizeModels.configured,
|
666
|
-
dirty;
|
667
|
-
|
668
|
-
// Analysis of the potential constraint feedback given the possibilities for the
|
669
|
-
// various constraints:
|
670
|
-
//
|
671
|
-
// #1: h < min, v > max : (Expand width, Shrink height)
|
672
|
-
// In general, making the panel wider could possibly cause the content to
|
673
|
-
// be shorter thereby eliminating the need to reduce the height, but we
|
674
|
-
// just measured the content width given effectively infinite space in
|
675
|
-
// which to expand. This means it is very unlikey (if not impossible) for
|
676
|
-
// the height to change given more width, so no special concerns.
|
677
|
-
//
|
678
|
-
// #2: h < min, v < min : (Expand width, Expand height)
|
679
|
-
// Making panel bigger in both directions has no concerns. Again, making
|
680
|
-
// the panel wider could only reduce height, so the need to expand the
|
681
|
-
// height would remain.
|
682
|
-
//
|
683
|
-
// #3: h > max, v > max : (Shrink width, Shrink height)
|
684
|
-
// Making the panel narrower cannot cause the maxHeight violation to go
|
685
|
-
// away, so no special concerns.
|
686
|
-
//
|
687
|
-
// #4: h > max, v < min : (Shrink width, Expand height)
|
688
|
-
// Finally an interesting case! Shrinking the width can cause the height
|
689
|
-
// to increase. We cannot know if it will increase enough to avoid the
|
690
|
-
// minHeight violation, but if we apply the minHeight constraint, we will
|
691
|
-
// not be able to tell that we should not have done so. Which means, in
|
692
|
-
// this case, we must only apply the maxWidth constraint, allowing the
|
693
|
-
// layout to rerun and perhaps apply the minHeight constraint next time.
|
694
|
-
|
695
|
-
// NOTE: if we are already applying a constraint on a given axis, that axis will
|
696
|
-
// *not* be in shrinkWrap mode.
|
697
|
-
|
698
|
-
if (horz.shrinkWrap && horzTooBig && vert.shrinkWrap && vertTooSmall) { // if (#4)
|
699
|
-
state.constrainedWidth = horz.maxSize;
|
700
|
-
ownerContext.widthModel = configured; // via maxWidth config
|
701
|
-
ret = false;
|
702
|
-
} else {
|
703
|
-
if (horz.shrinkWrap) {
|
704
|
-
if (horzTooBig) {
|
705
|
-
state.constrainedWidth = horz.maxSize;
|
706
|
-
ownerContext.widthModel = configured;
|
707
|
-
ret = false;
|
708
|
-
} else if (horzTooSmall) {
|
709
|
-
state.constrainedWidth = horz.minSize;
|
710
|
-
ownerContext.widthModel = configured;
|
711
|
-
ret = false;
|
712
|
-
}
|
713
|
-
}
|
714
|
-
|
715
|
-
if (vert.shrinkWrap) {
|
716
|
-
if (vertTooBig) {
|
717
|
-
state.constrainedHeight = vert.maxSize;
|
718
|
-
ownerContext.heightModel = configured;
|
719
|
-
ret = false;
|
720
|
-
} else if (vertTooSmall) {
|
721
|
-
state.constrainedHeight = vert.minSize;
|
722
|
-
ownerContext.heightModel = configured;
|
723
|
-
ret = false;
|
724
|
-
}
|
725
|
-
}
|
726
|
-
}
|
727
|
-
|
728
|
-
if (ret) {
|
729
|
-
if (horz.shrinkWrap) {
|
730
|
-
ownerContext.setWidth(horz.size);
|
731
|
-
}
|
732
|
-
if (vert.shrinkWrap) {
|
733
|
-
if (!ownerContext.collapsedVert && !this.owner.manageHeight) {
|
734
|
-
// height of the outerEl is provided by the height (including margins) of
|
735
|
-
// the bodyEl, so this value does not need to be written to the DOM:
|
736
|
-
dirty = false;
|
737
|
-
|
738
|
-
// so long as we set top and bottom margins on the bodyEl!
|
739
|
-
ownerContext.bodyContext.setProp('margin-bottom', vert.dockedPixelsEnd);
|
740
|
-
}
|
741
|
-
|
742
|
-
ownerContext.setHeight(vert.size, dirty);
|
743
|
-
}
|
744
|
-
} else {
|
745
|
-
ownerContext.invalidate({
|
746
|
-
state: {
|
747
|
-
constrainedWidth: state.constrainedWidth,
|
748
|
-
constrainedHeight: state.constrainedHeight
|
749
|
-
}
|
750
|
-
});
|
751
|
-
}
|
752
|
-
|
753
|
-
return ret;
|
754
|
-
},
|
755
|
-
|
756
|
-
/**
|
757
|
-
* Finishes the calculation by setting positions on the body and all of the items.
|
758
|
-
* @private
|
759
|
-
*/
|
760
|
-
finishPositions: function (ownerContext, horz, vert) {
|
761
|
-
var dockedItems = ownerContext.dockedItems,
|
762
|
-
length = dockedItems.length,
|
763
|
-
deltaX = horz.delta,
|
764
|
-
deltaY = vert.delta,
|
765
|
-
index, itemContext;
|
766
|
-
|
767
|
-
for (index = 0; index < length; ++index) {
|
768
|
-
itemContext = dockedItems[index];
|
769
|
-
|
770
|
-
itemContext.setProp('x', deltaX + itemContext.dockedAt.x);
|
771
|
-
itemContext.setProp('y', deltaY + itemContext.dockedAt.y);
|
772
|
-
}
|
773
|
-
},
|
774
|
-
|
775
|
-
finishedLayout: function(ownerContext) {
|
776
|
-
var me = this,
|
777
|
-
target = ownerContext.target;
|
778
|
-
|
779
|
-
me.callParent(arguments);
|
780
|
-
|
781
|
-
if (!ownerContext.animatePolicy) {
|
782
|
-
if (ownerContext.isCollapsingOrExpanding === 1) {
|
783
|
-
target.afterCollapse(false);
|
784
|
-
} else if (ownerContext.isCollapsingOrExpanding === 2) {
|
785
|
-
target.afterExpand(false);
|
786
|
-
}
|
787
|
-
}
|
788
|
-
},
|
789
|
-
|
790
|
-
getAnimatePolicy: function(ownerContext) {
|
791
|
-
var me = this,
|
792
|
-
lastCollapsedState, policy;
|
793
|
-
|
794
|
-
if (ownerContext.isCollapsingOrExpanding == 1) {
|
795
|
-
lastCollapsedState = me.lastCollapsedState;
|
796
|
-
} else if (ownerContext.isCollapsingOrExpanding == 2) {
|
797
|
-
lastCollapsedState = ownerContext.lastCollapsedState;
|
798
|
-
}
|
799
|
-
|
800
|
-
if (lastCollapsedState == 'left' || lastCollapsedState == 'right') {
|
801
|
-
policy = me.horizontalCollapsePolicy;
|
802
|
-
} else if (lastCollapsedState == 'top' || lastCollapsedState == 'bottom') {
|
803
|
-
policy = me.verticalCollapsePolicy;
|
804
|
-
}
|
805
|
-
|
806
|
-
return policy;
|
807
|
-
},
|
808
|
-
|
809
|
-
/**
|
810
|
-
* Retrieve an ordered and/or filtered array of all docked Components.
|
811
|
-
* @param {String} [order='render'] The desired ordering of the items ('render' or 'visual').
|
812
|
-
* @param {Boolean} [beforeBody] An optional flag to limit the set of items to only those
|
813
|
-
* before the body (true) or after the body (false). All components are returned by
|
814
|
-
* default.
|
815
|
-
* @return {Ext.Component[]} An array of components.
|
816
|
-
* @protected
|
817
|
-
*/
|
818
|
-
getDockedItems: function(order, beforeBody) {
|
819
|
-
var me = this,
|
820
|
-
all = me.owner.dockedItems.items,
|
821
|
-
sort = all && all.length && order !== false,
|
822
|
-
renderOrder,
|
823
|
-
dock, dockedItems, i, isBefore, length;
|
824
|
-
|
825
|
-
if (beforeBody == null) {
|
826
|
-
dockedItems = sort ? all.slice() : all;
|
827
|
-
} else {
|
828
|
-
dockedItems = [];
|
829
|
-
|
830
|
-
for (i = 0, length = all.length; i < length; ++i) {
|
831
|
-
dock = all[i].dock;
|
832
|
-
isBefore = (dock == 'top' || dock == 'left');
|
833
|
-
if (beforeBody ? isBefore : !isBefore) {
|
834
|
-
dockedItems.push(all[i]);
|
835
|
-
}
|
836
|
-
}
|
837
|
-
|
838
|
-
sort = sort && dockedItems.length;
|
839
|
-
}
|
840
|
-
|
841
|
-
if (sort) {
|
842
|
-
renderOrder = (order = order || 'render') == 'render';
|
843
|
-
Ext.Array.sort(dockedItems, function(a, b) {
|
844
|
-
var aw,
|
845
|
-
bw;
|
846
|
-
|
847
|
-
// If the two items are on opposite sides of the body, they must not be sorted by any weight value:
|
848
|
-
// For rendering purposes, left/top *always* sorts before right/bottom
|
849
|
-
if (renderOrder && ((aw = me.owner.dockOrder[a.dock]) !== (bw = me.owner.dockOrder[b.dock]))) {
|
850
|
-
|
851
|
-
// The two dockOrder values cancel out when two items are on opposite sides.
|
852
|
-
if (!(aw + bw)) {
|
853
|
-
return aw - bw;
|
854
|
-
}
|
855
|
-
}
|
856
|
-
|
857
|
-
aw = me.getItemWeight(a, order);
|
858
|
-
bw = me.getItemWeight(b, order);
|
859
|
-
if ((aw !== undefined) && (bw !== undefined)) {
|
860
|
-
return aw - bw;
|
861
|
-
}
|
862
|
-
return 0;
|
863
|
-
});
|
864
|
-
}
|
865
|
-
|
866
|
-
return dockedItems || [];
|
867
|
-
},
|
868
|
-
|
869
|
-
getItemWeight: function (item, order) {
|
870
|
-
var weight = item.weight || this.owner.defaultDockWeights[item.dock];
|
871
|
-
return weight[order] || weight;
|
872
|
-
},
|
873
|
-
|
874
|
-
/**
|
875
|
-
* @protected
|
876
|
-
* Returns an array containing all the **visible** docked items inside this layout's owner Panel
|
877
|
-
* @return {Array} An array containing all the **visible** docked items of the Panel
|
878
|
-
*/
|
879
|
-
getLayoutItems : function() {
|
880
|
-
var me = this,
|
881
|
-
items,
|
882
|
-
itemCount,
|
883
|
-
item,
|
884
|
-
i,
|
885
|
-
result;
|
886
|
-
|
887
|
-
if (me.owner.collapsed) {
|
888
|
-
result = me.owner.getCollapsedDockedItems();
|
889
|
-
} else {
|
890
|
-
items = me.getDockedItems('visual');
|
891
|
-
itemCount = items.length;
|
892
|
-
result = [];
|
893
|
-
for (i = 0; i < itemCount; i++) {
|
894
|
-
item = items[i];
|
895
|
-
if (!item.hidden) {
|
896
|
-
result.push(item);
|
897
|
-
}
|
898
|
-
}
|
899
|
-
}
|
900
|
-
return result;
|
901
|
-
},
|
902
|
-
|
903
|
-
// Content size includes padding but not borders, so subtract them off
|
904
|
-
measureContentWidth: function (ownerContext) {
|
905
|
-
var bodyContext = ownerContext.bodyContext;
|
906
|
-
return bodyContext.el.getWidth() - bodyContext.getBorderInfo().width;
|
907
|
-
},
|
908
|
-
|
909
|
-
measureContentHeight: function (ownerContext) {
|
910
|
-
var bodyContext = ownerContext.bodyContext;
|
911
|
-
return bodyContext.el.getHeight() - bodyContext.getBorderInfo().height;
|
912
|
-
},
|
913
|
-
|
914
|
-
redoLayout: function(ownerContext) {
|
915
|
-
var me = this,
|
916
|
-
owner = me.owner;
|
917
|
-
|
918
|
-
// If we are collapsing...
|
919
|
-
if (ownerContext.isCollapsingOrExpanding == 1) {
|
920
|
-
if (owner.reExpander) {
|
921
|
-
owner.reExpander.el.show();
|
922
|
-
}
|
923
|
-
// Add the collapsed class now, so that collapsed CSS rules are applied before measurements are taken by the layout.
|
924
|
-
owner.addClsWithUI(owner.collapsedCls);
|
925
|
-
ownerContext.redo(true);
|
926
|
-
} else if (ownerContext.isCollapsingOrExpanding == 2) {
|
927
|
-
// Remove the collapsed class now, before layout calculations are done.
|
928
|
-
owner.removeClsWithUI(owner.collapsedCls);
|
929
|
-
ownerContext.bodyContext.redo();
|
930
|
-
}
|
931
|
-
},
|
932
|
-
|
933
|
-
// @private override inherited.
|
934
|
-
// We need to render in the correct order, top/left before bottom/right
|
935
|
-
renderChildren: function() {
|
936
|
-
var me = this,
|
937
|
-
items = me.getDockedItems(),
|
938
|
-
target = me.getRenderTarget();
|
939
|
-
|
940
|
-
me.renderItems(items, target);
|
941
|
-
},
|
942
|
-
|
943
|
-
/**
|
944
|
-
* @protected
|
945
|
-
* Render the top and left docked items before any existing DOM nodes in our render target,
|
946
|
-
* and then render the right and bottom docked items after. This is important, for such things
|
947
|
-
* as tab stops and ARIA readers, that the DOM nodes are in a meaningful order.
|
948
|
-
* Our collection of docked items will already be ordered via Panel.getDockedItems().
|
949
|
-
*/
|
950
|
-
renderItems: function(items, target) {
|
951
|
-
var me = this,
|
952
|
-
dockedItemCount = items.length,
|
953
|
-
itemIndex = 0,
|
954
|
-
correctPosition = 0,
|
955
|
-
item,
|
956
|
-
staticNodeCount = 0,
|
957
|
-
targetNodes = me.getRenderTarget().dom.childNodes,
|
958
|
-
targetChildCount = targetNodes.length,
|
959
|
-
i, j, targetChildNode, item;
|
960
|
-
|
961
|
-
// Calculate the number of DOM nodes in our target that are not our docked items
|
962
|
-
for (i = 0, j = 0; i < targetChildCount; i++) {
|
963
|
-
targetChildNode = targetNodes[i];
|
964
|
-
if (Ext.fly(targetChildNode).hasCls('x-resizable-handle')) {
|
965
|
-
break;
|
966
|
-
}
|
967
|
-
for (j = 0; j < dockedItemCount; j++) {
|
968
|
-
item = items[j];
|
969
|
-
if (item.rendered && item.el.dom === targetChildNode) {
|
970
|
-
break;
|
971
|
-
}
|
972
|
-
}
|
973
|
-
// Walked off the end of the docked items without matching the found child node;
|
974
|
-
// Then it's a static node.
|
975
|
-
if (j === dockedItemCount) {
|
976
|
-
staticNodeCount++;
|
977
|
-
}
|
978
|
-
}
|
979
|
-
|
980
|
-
// Now we go through our docked items and render/move them
|
981
|
-
for (; itemIndex < dockedItemCount; itemIndex++, correctPosition++) {
|
982
|
-
item = items[itemIndex];
|
983
|
-
|
984
|
-
// If we're now at the first right/bottom docked item, we jump over the body element.
|
985
|
-
//
|
986
|
-
// TODO: This is affected if users provide custom weight values to their
|
987
|
-
// docked items, which puts it out of (t,l,r,b) order. Avoiding a second
|
988
|
-
// sort operation here, for now, in the name of performance. getDockedItems()
|
989
|
-
// needs the sort operation not just for this layout-time rendering, but
|
990
|
-
// also for getRefItems() to return a logical ordering (FocusManager, CQ, et al).
|
991
|
-
if (itemIndex === correctPosition && (item.dock === 'right' || item.dock === 'bottom')) {
|
992
|
-
correctPosition += staticNodeCount;
|
993
|
-
}
|
994
|
-
|
995
|
-
// Same logic as Layout.renderItems()
|
996
|
-
if (item && !item.rendered) {
|
997
|
-
me.renderItem(item, target, correctPosition);
|
998
|
-
}
|
999
|
-
else if (!me.isValidParent(item, target, correctPosition)) {
|
1000
|
-
me.moveItem(item, target, correctPosition);
|
1001
|
-
}
|
1002
|
-
}
|
1003
|
-
},
|
1004
|
-
|
1005
|
-
undoLayout: function(ownerContext) {
|
1006
|
-
var me = this,
|
1007
|
-
owner = me.owner;
|
1008
|
-
|
1009
|
-
// If we are collapsing...
|
1010
|
-
if (ownerContext.isCollapsingOrExpanding == 1) {
|
1011
|
-
|
1012
|
-
// We do not want to see the re-expander header until the final collapse is complete
|
1013
|
-
if (owner.reExpander) {
|
1014
|
-
owner.reExpander.el.hide();
|
1015
|
-
}
|
1016
|
-
// Add the collapsed class now, so that collapsed CSS rules are applied before measurements are taken by the layout.
|
1017
|
-
owner.removeClsWithUI(owner.collapsedCls);
|
1018
|
-
ownerContext.undo(true);
|
1019
|
-
} else if (ownerContext.isCollapsingOrExpanding == 2) {
|
1020
|
-
// Remove the collapsed class now, before layout calculations are done.
|
1021
|
-
owner.addClsWithUI(owner.collapsedCls);
|
1022
|
-
ownerContext.bodyContext.undo();
|
1023
|
-
}
|
1024
|
-
},
|
1025
|
-
|
1026
|
-
sizePolicy: {
|
1027
|
-
nostretch: {
|
1028
|
-
setsWidth: 0,
|
1029
|
-
setsHeight: 0
|
1030
|
-
},
|
1031
|
-
stretchH: {
|
1032
|
-
setsWidth: 1,
|
1033
|
-
setsHeight: 0
|
1034
|
-
},
|
1035
|
-
stretchV: {
|
1036
|
-
setsWidth: 0,
|
1037
|
-
setsHeight: 1
|
1038
|
-
},
|
1039
|
-
|
1040
|
-
// Circular dependency with partial auto-sized panels:
|
1041
|
-
//
|
1042
|
-
// If we have an autoHeight docked item being stretched horizontally (top/bottom),
|
1043
|
-
// that stretching will determine its width and its width must be set before its
|
1044
|
-
// autoHeight can be determined. If that item is docked in an autoWidth panel, the
|
1045
|
-
// body will need its height set before it can determine its width, but the height
|
1046
|
-
// of the docked item is needed to subtract from the panel height in order to set
|
1047
|
-
// the body height.
|
1048
|
-
//
|
1049
|
-
// This same pattern occurs with autoHeight panels with autoWidth docked items on
|
1050
|
-
// left or right. If the panel is fully auto or fully fixed, these problems don't
|
1051
|
-
// come up because there is no dependency between the dimensions.
|
1052
|
-
//
|
1053
|
-
// Cutting the Gordian Knot: In these cases, we have to allow something to measure
|
1054
|
-
// itself without full context. This is OK as long as the managed dimension doesn't
|
1055
|
-
// effect the auto-dimension, which is often the case for things like toolbars. The
|
1056
|
-
// managed dimension only effects overflow handlers and such and does not change the
|
1057
|
-
// auto-dimension. To encourage the item to measure itself without waiting for the
|
1058
|
-
// managed dimension, we have to tell it that the layout will also be reading that
|
1059
|
-
// dimension. This is similar to how stretchmax works.
|
1060
|
-
|
1061
|
-
autoStretchH: {
|
1062
|
-
readsWidth: 1,
|
1063
|
-
setsWidth: 1,
|
1064
|
-
setsHeight: 0
|
1065
|
-
},
|
1066
|
-
autoStretchV: {
|
1067
|
-
readsHeight: 1,
|
1068
|
-
setsWidth: 0,
|
1069
|
-
setsHeight: 1
|
1070
|
-
}
|
1071
|
-
},
|
1072
|
-
|
1073
|
-
getItemSizePolicy: function (item) {
|
1074
|
-
var policy = this.sizePolicy,
|
1075
|
-
dock, vertical;
|
1076
|
-
|
1077
|
-
if (item.stretch === false) {
|
1078
|
-
return policy.nostretch;
|
1079
|
-
}
|
1080
|
-
|
1081
|
-
dock = item.dock;
|
1082
|
-
vertical = (dock == 'left' || dock == 'right');
|
1083
|
-
|
1084
|
-
/*
|
1085
|
-
owner = this.owner;
|
1086
|
-
autoWidth = !owner.isFixedWidth();
|
1087
|
-
autoHeight = !owner.isFixedHeight();
|
1088
|
-
if (autoWidth !== autoHeight) { // if (partial auto)
|
1089
|
-
// see above...
|
1090
|
-
if (vertical) {
|
1091
|
-
if (autoHeight) {
|
1092
|
-
return policy.autoStretchV;
|
1093
|
-
}
|
1094
|
-
} else if (autoWidth) {
|
1095
|
-
return policy.autoStretchH;
|
1096
|
-
}
|
1097
|
-
}*/
|
1098
|
-
|
1099
|
-
if (vertical) {
|
1100
|
-
return policy.stretchV;
|
1101
|
-
}
|
1102
|
-
|
1103
|
-
return policy.stretchH;
|
1104
|
-
},
|
1105
|
-
|
1106
|
-
/**
|
1107
|
-
* @protected
|
1108
|
-
* We are overriding the Ext.layout.Layout configureItem method to also add a class that
|
1109
|
-
* indicates the position of the docked item. We use the itemCls (x-docked) as a prefix.
|
1110
|
-
* An example of a class added to a dock: right item is x-docked-right
|
1111
|
-
* @param {Ext.Component} item The item we are configuring
|
1112
|
-
*/
|
1113
|
-
configureItem : function(item, pos) {
|
1114
|
-
this.callParent(arguments);
|
1115
|
-
|
1116
|
-
item.addCls(Ext.baseCSSPrefix + 'docked');
|
1117
|
-
item.addClsWithUI('docked-' + item.dock);
|
1118
|
-
},
|
1119
|
-
|
1120
|
-
afterRemove : function(item) {
|
1121
|
-
this.callParent(arguments);
|
1122
|
-
if (this.itemCls) {
|
1123
|
-
item.el.removeCls(this.itemCls + '-' + item.dock);
|
1124
|
-
}
|
1125
|
-
var dom = item.el.dom;
|
1126
|
-
|
1127
|
-
if (!item.destroying && dom) {
|
1128
|
-
dom.parentNode.removeChild(dom);
|
1129
|
-
}
|
1130
|
-
this.childrenChanged = true;
|
1131
|
-
}
|
1132
|
-
});
|