Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit c86fe9b

Browse files
committed
Merge pull request #45 from jbroquist/v1-beta
Version 1.0
2 parents 8bff5f7 + a95b7ff commit c86fe9b

File tree

10 files changed

+940
-394
lines changed

10 files changed

+940
-394
lines changed

README.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ This directive allows you to split stuff !
99

1010
**NOTE :** if you use IE<=9, iOS<7 or Android<4 please include the [requestAnimationFrame polyfill](https://github.com/darius/requestAnimationFrame/blob/master/requestAnimationFrame.js) in your application.
1111

12+
**NOTE :** version 1.x is only compatible with IE>=10. If you use IE<=9 you need to use version 0.x
13+
1214

1315
## Usage
1416

@@ -57,8 +59,26 @@ Default: `'row'`
5759

5860
A fake [flex-direction property](http://www.w3.org/TR/css3-flexbox/#flex-direction). It specifies how the child elements are placed in the layout container, by setting the direction of the flex container's main axis. This determines the direction that child elements are laid out in.
5961

62+
### dividerSize
63+
64+
Type: `Integer`
65+
Default: `10`
66+
67+
The size in pixels that you want the divider/splitbar to be.
68+
6069
## Child Attributes
6170

71+
### uiLayoutContainer
72+
73+
Required on all child elements of the ui-layout element.
74+
75+
```
76+
<div ui-layout>
77+
<div ui-layout-container></div>
78+
<div ui-layout-container></div>
79+
</div>
80+
```
81+
6282
### size
6383
Type: `String`
6484

@@ -67,12 +87,12 @@ Sets the default placement of the splitbar.
6787
```
6888
pixels
6989
<div ui-layout>
70-
<div size="100px"></div>
90+
<div ui-layout-container size="100px"></div>
7191
</div>
7292
7393
percentage
7494
<div ui-layout>
75-
<div size="10%"></div>
95+
<div ui-layout-container size="10%"></div>
7696
</div>
7797
```
7898

@@ -86,12 +106,12 @@ Specifices the minimum size the child element can be set to. Defaults to the wid
86106
```
87107
pixels
88108
<div ui-layout>
89-
<div min-size="100px"></div>
109+
<div ui-layout-container min-size="100px"></div>
90110
</div>
91111
92112
percentage
93113
<div ui-layout>
94-
<div min-size="10%"></div>
114+
<div ui-layout-container min-size="10%"></div>
95115
</div>
96116
```
97117

@@ -104,12 +124,12 @@ Specifices the maxium size the child element can be set to.
104124
```
105125
pixels
106126
<div ui-layout>
107-
<div max-size="100px"></div>
127+
<div ui-layout-container max-size="100px"></div>
108128
</div>
109129
110130
percentage
111131
<div ui-layout>
112-
<div max-size="10%"></div>
132+
<div ui-layout-container max-size="10%"></div>
113133
</div>
114134
```
115135

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-ui-layout",
3-
"main": "ui-layout.js",
4-
"version": "0.0.1",
3+
"main": ["src/ui-layout.js", "src/ui-layout.css"],
4+
"version": "1.0.0",
55
"homepage": "https://angular-ui.github.io/ui-layout/",
66
"authors": [
77
"https://github.com/angular-ui/ui-layout/contributors"

demo/demo.html

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,15 @@ <h1>Initial size demo</h1>
142142
<div class="col-md-6">
143143
<div style="position: relative; height: 600px;">
144144
<div ui-layout class="layout-mock">
145-
<header class="north-back"></header>
146-
<div class="center-back" size="10%"></div>
147-
<footer ui-layout="{ flow : 'column', sizes: [ '300px' ] }" >
148-
<div class="west-back"></div>
149-
<div class="south-back"></div>
150-
<div size="100px"></div>
145+
<header ui-layout-container class="north-back"></header>
146+
<div ui-layout-container class="center-back" size="10%"></div>
147+
<footer ui-layout-container>
148+
<div ui-layout="{ flow : 'column', sizes: [ '300px' ] }">
149+
<div ui-layout-container class="west-back"></div>
150+
<div ui-layout-container class="south-back"></div>
151+
<div ui-layout-container size="100px"></div>
152+
</div>
153+
151154
</footer>
152155
</div>
153156
</div>
@@ -169,12 +172,14 @@ <h1>Initial size demo</h1>
169172
<tab heading="Markup">
170173
<div plunker-content="markup">
171174
<pre class="prettyprint">&lt;div ui-layout class=&quot;layout-mock&quot;&gt;
172-
&lt;header class=&quot;north-back&quot;&gt;&lt;/header&gt;
173-
&lt;div class=&quot;center-back&quot; size=&quot;10%&quot;&gt;&lt;/div&gt;
174-
&lt;footer ui-layout=&quot;{ flow : &#39;column&#39;, sizes: [ &#39;300px&#39; ] }&quot; &gt;
175-
&lt;div class=&quot;west-back&quot;&gt;&lt;/div&gt;
176-
&lt;div class=&quot;south-back&quot;&gt;&lt;/div&gt;
177-
&lt;div size=&quot;100px&quot;&gt;&lt;/div&gt;
175+
&lt;header ui-layout-container class=&quot;north-back&quot;&gt;&lt;/header&gt;
176+
&lt;div ui-layout-container class=&quot;center-back&quot; size=&quot;10%&quot;&gt;&lt;/div&gt;
177+
&lt;footer ui-layout-container &gt;
178+
&lt;div ui-layout=&quot;{ flow : &#39;column&#39;, sizes: [ &#39;300px&#39; ] }&quot; &gt;
179+
&lt;div ui-layout-container class=&quot;west-back&quot;&gt;&lt;/div&gt;
180+
&lt;div ui-layout-container class=&quot;south-back&quot;&gt;&lt;/div&gt;
181+
&lt;div ui-layout-container size=&quot;100px&quot;&gt;&lt;/div&gt;
182+
&lt;/div&gt;
178183
&lt;/footer&gt;
179184
&lt;/div&gt;</pre>
180185
</div>

demo/demo2.html

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!DOCTYPE html>
2+
<html ng-app="x">
3+
<head lang="en">
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width">
6+
7+
<title></title>
8+
9+
<!-- Le css -->
10+
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
11+
<link rel="stylesheet" type="text/css" href="../src/ui-layout.css"/>
12+
13+
<!-- Le javascript -->
14+
<script type="application/javascript" src="../bower_components/angular/angular.js"></script>
15+
<script type="application/javascript" src="../src/ui-layout.js"></script>
16+
<script type="application/javascript">
17+
18+
var app = angular.module('x', ['ui.layout']);
19+
app.controller('DemoController', function($scope) {
20+
$scope.config = {
21+
flow: 'column'
22+
}
23+
});
24+
25+
</script>
26+
<style>
27+
.red {
28+
background-color: red;
29+
}
30+
.green {
31+
background-color: green;
32+
}
33+
.ui-splitbar {
34+
background-color: red;
35+
}
36+
.ui-layout-container {
37+
display: inline-block;
38+
}
39+
</style>
40+
</head>
41+
<body ng-controller="DemoController">
42+
<div ui-layout="config">
43+
<div ui-layout-container max-size="50%">
44+
One
45+
<br/>
46+
<button ng-click="updateDisplay()">Update Display</button>
47+
</div>
48+
<div ui-layout-container collapsed="false">Two</div>
49+
<div ui-layout-container>
50+
<!--Three-->
51+
<div ui-layout="{ flow:'row', dividerSize:'12' }">
52+
<div ui-layout-container>Three</div>
53+
<div ui-layout-container>
54+
<div ng-include="demo/testinclude.html"></div>
55+
</div>
56+
</div>
57+
</div>
58+
<div ui-layout-container>
59+
Four
60+
</div>
61+
</div>
62+
</body>
63+
</html>

demo/testinclude.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>
2+
My included contents.
3+
</p>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-ui-layout",
3-
"version": "0.0.1",
3+
"version": "1.0.0",
44
"description": "This directive allows you to split !",
55
"devDependencies": {
66
"gulp": "^3",

src/ui-layout.css

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,37 @@
1313
}
1414

1515
.ui-splitbar{
16-
display: block;
16+
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
17+
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
18+
display: -ms-flexbox; /* TWEENER - IE 10 */
19+
display: -webkit-flex; /* NEW - Chrome */
20+
display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */
21+
-webkit-justify-content: center;
22+
justify-content: center;
23+
1724
background-color: #ffffff;
1825
right: auto;
1926
position: absolute;
20-
z-index: 99999;
27+
z-index: 1010;
2128
}
2229

2330
.ui-layout-row > .ui-splitbar{
2431
height: 8px; width: 100%;
2532
cursor: row-resize;
33+
text-align: center;
34+
justify-content: center;
35+
align-items: center;
2636
}
2737
.ui-layout-column > .ui-splitbar{
2838
width: 8px; height: 100%;
2939
cursor: col-resize;
40+
-webkit-flex-direction: column;
41+
flex-direction: column;
3042
}
43+
44+
.ui-layout-column > .ui-splitbar > a,
45+
.ui-layout-row > .ui-splitbar > a {
46+
color: #fff;
47+
cursor: pointer;
48+
font-size: 9px;
49+
}

0 commit comments

Comments
 (0)