Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

feat #80 bindable width and height for containers #347

Closed
wants to merge 1 commit into from

2 participants

jakub-g divdavem
jakub-g
Collaborator

Adds possibility to bind width and height for some of container-based widgets (Div, Dialog, Fieldset, TabPanel). The bound size is a subject to min/max size constraints for all of those widgets.

This commit lifts the requirement for widgets to have width/height = -1 for min/max width/height to work. So this is backward-incompatible change in some way, but the behavior of width & maxwidth etc. when provided
together was undefined earlier, so it should not have relied upon by anyone.

Close #80.

jakub-g jakub-g referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
jakub-g jakub-g referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
jakub-g jakub-g referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
jakub-g jakub-g referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
divdavem divdavem was assigned
divdavem divdavem commented on the diff
src/aria/widgets/container/Container.js
((60 lines not shown))
if (this._changedContainerSize) {
- domElt.style.width = cfg.width > -1 ? cfg.width + "px" : "";
- domElt.style.height = cfg.height > -1 ? cfg.height + "px" : "";
- if (this._frame) {
- this._frame.resize(cfg.width, cfg.height);
+ var constrainedWidth = aria.utils.Math.normalize(cfg.width, widthConf.min, widthConf.max);
+ var constrainedHeight = aria.utils.Math.normalize(cfg.height, heightConf.min, heightConf.max);
divdavem Collaborator

aria.utils.Math should be added as a dependency of this class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
test/aria/widgets/container/issue80/DivTest.js
((3 lines not shown))
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Test case for aria.widgets.container.Dialog
+ */
divdavem Collaborator

Is this really a test case for the Dialog? (or was that comment forgotten after a copy/paste?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
test/aria/widgets/container/issue80/FieldsetTest.js
((3 lines not shown))
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Test case for aria.widgets.container.Dialog
+ */
divdavem Collaborator

Is this really a test case for the Dialog? (or was that comment forgotten after a copy/paste?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
test/aria/widgets/container/issue80/TabpanelTest.js
((3 lines not shown))
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Test case for aria.widgets.container.Dialog
+ */
divdavem Collaborator

Is this really a test case for the Dialog? (or was that comment forgotten after a copy/paste?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
...gets/container/issue80/shared/BindableSizeTestCase.js
((3 lines not shown))
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Test case for aria.widgets.container.Dialog
+ */
divdavem Collaborator

Isn't this more general than a test case for the Dialog?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
jakub-g jakub-g feat #80 bindable width and height for containers
Adds possibility to bind width and height for some of container-based
widgets (Div, Dialog, Fieldset, TabPanel). The bound size is a subject to
min/max size constraints for all of those widgets.

This commit lifts the requirement for widgets to have width/height = -1
for min/max width/height to work. So this is backward-incompatible change
in some way, but the behavior of width & maxwidth etc. when provided
together was undefined earlier, so it should not have relied upon by anyone.

Apart from the bindable width/height tests, this commit brings also
a test case on static height constraints of the Dialog widget and their
behavior when the contents od the Dialog change due to a refresh.

Close #80. Close #347.
0481664
divdavem divdavem closed this pull request from a commit
jakub-g jakub-g feat #80 bindable width and height for containers
Adds possibility to bind width and height for some of container-based
widgets (Div, Dialog, Fieldset, TabPanel). The bound size is a subject to
min/max size constraints for all of those widgets.

This commit lifts the requirement for widgets to have width/height = -1
for min/max width/height to work. So this is backward-incompatible change
in some way, but the behavior of width & maxwidth etc. when provided
together was undefined earlier, so it should not have relied upon by anyone.

Apart from the bindable width/height tests, this commit brings also
a test case on static height constraints of the Dialog widget and their
behavior when the contents od the Dialog change due to a refresh.

Close #80. Close #347.
d93ea66
divdavem divdavem closed this in d93ea66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 28, 2013
  1. jakub-g

    feat #80 bindable width and height for containers

    jakub-g authored
    Adds possibility to bind width and height for some of container-based
    widgets (Div, Dialog, Fieldset, TabPanel). The bound size is a subject to
    min/max size constraints for all of those widgets.
    
    This commit lifts the requirement for widgets to have width/height = -1
    for min/max width/height to work. So this is backward-incompatible change
    in some way, but the behavior of width & maxwidth etc. when provided
    together was undefined earlier, so it should not have relied upon by anyone.
    
    Apart from the bindable width/height tests, this commit brings also
    a test case on static height constraints of the Dialog widget and their
    behavior when the contents od the Dialog change due to a refresh.
    
    Close #80. Close #347.
Something went wrong with that request. Please try again.