mirror of https://github.com/twbs/bootstrap.git
grunt
This commit is contained in:
parent
6def7a5d56
commit
571e86e770
|
@ -2113,7 +2113,7 @@ pre code {
|
||||||
.table-responsive {
|
.table-responsive {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: .01%;
|
min-height: 0%;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2252,10 +2252,11 @@ select.form-control:focus::-ms-value {
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control-static {
|
.form-control-static {
|
||||||
min-height: 2.5rem;
|
|
||||||
padding-top: 0.5rem;
|
padding-top: 0.5rem;
|
||||||
padding-bottom: 0.5rem;
|
padding-bottom: 0.5rem;
|
||||||
margin-bottom: 0;
|
line-height: 1.25;
|
||||||
|
border: solid transparent;
|
||||||
|
border-width: 1px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control-static.form-control-sm, .input-group-sm > .form-control-static.form-control,
|
.form-control-static.form-control-sm, .input-group-sm > .form-control-static.form-control,
|
||||||
|
@ -2379,18 +2380,19 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
border-color: #5cb85c;
|
border-color: #5cb85c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-success .form-control:focus {
|
||||||
|
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #a3d7a3;
|
||||||
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #a3d7a3;
|
||||||
|
}
|
||||||
|
|
||||||
.has-success .input-group-addon {
|
.has-success .input-group-addon {
|
||||||
color: #5cb85c;
|
color: #5cb85c;
|
||||||
border-color: #5cb85c;
|
border-color: #5cb85c;
|
||||||
background-color: #eaf6ea;
|
background-color: #eaf6ea;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-success .form-control-feedback {
|
|
||||||
color: #5cb85c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.has-success .form-control-success {
|
.has-success .form-control-success {
|
||||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='$form-icon-success-color' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#5cb85c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-warning .form-control-feedback,
|
.has-warning .form-control-feedback,
|
||||||
|
@ -2405,16 +2407,17 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
border-color: #f0ad4e;
|
border-color: #f0ad4e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-warning .form-control:focus {
|
||||||
|
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8d9ac;
|
||||||
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8d9ac;
|
||||||
|
}
|
||||||
|
|
||||||
.has-warning .input-group-addon {
|
.has-warning .input-group-addon {
|
||||||
color: #f0ad4e;
|
color: #f0ad4e;
|
||||||
border-color: #f0ad4e;
|
border-color: #f0ad4e;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-warning .form-control-feedback {
|
|
||||||
color: #f0ad4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.has-warning .form-control-warning {
|
.has-warning .form-control-warning {
|
||||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#f0ad4e' d='M4.4 5.324h-.8v-2.46h.8zm0 1.42h-.8V5.89h.8zM3.76.63L.04 7.075c-.115.2.016.425.26.426h7.397c.242 0 .372-.226.258-.426C6.726 4.924 5.47 2.79 4.253.63c-.113-.174-.39-.174-.494 0z'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#f0ad4e' d='M4.4 5.324h-.8v-2.46h.8zm0 1.42h-.8V5.89h.8zM3.76.63L.04 7.075c-.115.2.016.425.26.426h7.397c.242 0 .372-.226.258-.426C6.726 4.924 5.47 2.79 4.253.63c-.113-.174-.39-.174-.494 0z'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
@ -2431,16 +2434,17 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
border-color: #d9534f;
|
border-color: #d9534f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-danger .form-control:focus {
|
||||||
|
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #eba5a3;
|
||||||
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #eba5a3;
|
||||||
|
}
|
||||||
|
|
||||||
.has-danger .input-group-addon {
|
.has-danger .input-group-addon {
|
||||||
color: #d9534f;
|
color: #d9534f;
|
||||||
border-color: #d9534f;
|
border-color: #d9534f;
|
||||||
background-color: #fdf7f7;
|
background-color: #fdf7f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-danger .form-control-feedback {
|
|
||||||
color: #d9534f;
|
|
||||||
}
|
|
||||||
|
|
||||||
.has-danger .form-control-danger {
|
.has-danger .form-control-danger {
|
||||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
@ -2461,6 +2465,7 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
}
|
}
|
||||||
.form-inline .input-group {
|
.form-inline .input-group {
|
||||||
display: inline-table;
|
display: inline-table;
|
||||||
|
width: auto;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.form-inline .input-group .input-group-addon,
|
.form-inline .input-group .input-group-addon,
|
||||||
|
@ -5080,6 +5085,7 @@ base::-moz-progress-bar,
|
||||||
.media-middle {
|
.media-middle {
|
||||||
-webkit-align-self: center;
|
-webkit-align-self: center;
|
||||||
-ms-flex-item-align: center;
|
-ms-flex-item-align: center;
|
||||||
|
-ms-grid-row-align: center;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5177,6 +5183,8 @@ base::-moz-progress-bar,
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-group-flush .list-group-item {
|
.list-group-flush .list-group-item {
|
||||||
|
border-right: 0;
|
||||||
|
border-left: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6126,7 +6134,6 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: start;
|
-webkit-box-align: start;
|
||||||
-webkit-align-items: flex-start;
|
-webkit-align-items: flex-start;
|
||||||
-ms-flex-align: start;
|
-ms-flex-align: start;
|
||||||
-ms-grid-row-align: flex-start;
|
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6134,7 +6141,6 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: center;
|
-webkit-box-align: center;
|
||||||
-webkit-align-items: center;
|
-webkit-align-items: center;
|
||||||
-ms-flex-align: center;
|
-ms-flex-align: center;
|
||||||
-ms-grid-row-align: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6142,7 +6148,6 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: end;
|
-webkit-box-align: end;
|
||||||
-webkit-align-items: flex-end;
|
-webkit-align-items: flex-end;
|
||||||
-ms-flex-align: end;
|
-ms-flex-align: end;
|
||||||
-ms-grid-row-align: flex-end;
|
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6155,6 +6160,7 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
.flex-xs-middle {
|
.flex-xs-middle {
|
||||||
-webkit-align-self: center;
|
-webkit-align-self: center;
|
||||||
-ms-flex-item-align: center;
|
-ms-flex-item-align: center;
|
||||||
|
-ms-grid-row-align: center;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6224,21 +6230,18 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: start;
|
-webkit-box-align: start;
|
||||||
-webkit-align-items: flex-start;
|
-webkit-align-items: flex-start;
|
||||||
-ms-flex-align: start;
|
-ms-flex-align: start;
|
||||||
-ms-grid-row-align: flex-start;
|
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
.flex-items-sm-middle {
|
.flex-items-sm-middle {
|
||||||
-webkit-box-align: center;
|
-webkit-box-align: center;
|
||||||
-webkit-align-items: center;
|
-webkit-align-items: center;
|
||||||
-ms-flex-align: center;
|
-ms-flex-align: center;
|
||||||
-ms-grid-row-align: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.flex-items-sm-bottom {
|
.flex-items-sm-bottom {
|
||||||
-webkit-box-align: end;
|
-webkit-box-align: end;
|
||||||
-webkit-align-items: flex-end;
|
-webkit-align-items: flex-end;
|
||||||
-ms-flex-align: end;
|
-ms-flex-align: end;
|
||||||
-ms-grid-row-align: flex-end;
|
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6252,6 +6255,7 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
.flex-sm-middle {
|
.flex-sm-middle {
|
||||||
-webkit-align-self: center;
|
-webkit-align-self: center;
|
||||||
-ms-flex-item-align: center;
|
-ms-flex-item-align: center;
|
||||||
|
-ms-grid-row-align: center;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
.flex-sm-bottom {
|
.flex-sm-bottom {
|
||||||
|
@ -6319,21 +6323,18 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: start;
|
-webkit-box-align: start;
|
||||||
-webkit-align-items: flex-start;
|
-webkit-align-items: flex-start;
|
||||||
-ms-flex-align: start;
|
-ms-flex-align: start;
|
||||||
-ms-grid-row-align: flex-start;
|
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
.flex-items-md-middle {
|
.flex-items-md-middle {
|
||||||
-webkit-box-align: center;
|
-webkit-box-align: center;
|
||||||
-webkit-align-items: center;
|
-webkit-align-items: center;
|
||||||
-ms-flex-align: center;
|
-ms-flex-align: center;
|
||||||
-ms-grid-row-align: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.flex-items-md-bottom {
|
.flex-items-md-bottom {
|
||||||
-webkit-box-align: end;
|
-webkit-box-align: end;
|
||||||
-webkit-align-items: flex-end;
|
-webkit-align-items: flex-end;
|
||||||
-ms-flex-align: end;
|
-ms-flex-align: end;
|
||||||
-ms-grid-row-align: flex-end;
|
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6347,6 +6348,7 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
.flex-md-middle {
|
.flex-md-middle {
|
||||||
-webkit-align-self: center;
|
-webkit-align-self: center;
|
||||||
-ms-flex-item-align: center;
|
-ms-flex-item-align: center;
|
||||||
|
-ms-grid-row-align: center;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
.flex-md-bottom {
|
.flex-md-bottom {
|
||||||
|
@ -6414,21 +6416,18 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: start;
|
-webkit-box-align: start;
|
||||||
-webkit-align-items: flex-start;
|
-webkit-align-items: flex-start;
|
||||||
-ms-flex-align: start;
|
-ms-flex-align: start;
|
||||||
-ms-grid-row-align: flex-start;
|
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
.flex-items-lg-middle {
|
.flex-items-lg-middle {
|
||||||
-webkit-box-align: center;
|
-webkit-box-align: center;
|
||||||
-webkit-align-items: center;
|
-webkit-align-items: center;
|
||||||
-ms-flex-align: center;
|
-ms-flex-align: center;
|
||||||
-ms-grid-row-align: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.flex-items-lg-bottom {
|
.flex-items-lg-bottom {
|
||||||
-webkit-box-align: end;
|
-webkit-box-align: end;
|
||||||
-webkit-align-items: flex-end;
|
-webkit-align-items: flex-end;
|
||||||
-ms-flex-align: end;
|
-ms-flex-align: end;
|
||||||
-ms-grid-row-align: flex-end;
|
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6442,6 +6441,7 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
.flex-lg-middle {
|
.flex-lg-middle {
|
||||||
-webkit-align-self: center;
|
-webkit-align-self: center;
|
||||||
-ms-flex-item-align: center;
|
-ms-flex-item-align: center;
|
||||||
|
-ms-grid-row-align: center;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
.flex-lg-bottom {
|
.flex-lg-bottom {
|
||||||
|
@ -6509,21 +6509,18 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: start;
|
-webkit-box-align: start;
|
||||||
-webkit-align-items: flex-start;
|
-webkit-align-items: flex-start;
|
||||||
-ms-flex-align: start;
|
-ms-flex-align: start;
|
||||||
-ms-grid-row-align: flex-start;
|
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
.flex-items-xl-middle {
|
.flex-items-xl-middle {
|
||||||
-webkit-box-align: center;
|
-webkit-box-align: center;
|
||||||
-webkit-align-items: center;
|
-webkit-align-items: center;
|
||||||
-ms-flex-align: center;
|
-ms-flex-align: center;
|
||||||
-ms-grid-row-align: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.flex-items-xl-bottom {
|
.flex-items-xl-bottom {
|
||||||
-webkit-box-align: end;
|
-webkit-box-align: end;
|
||||||
-webkit-align-items: flex-end;
|
-webkit-align-items: flex-end;
|
||||||
-ms-flex-align: end;
|
-ms-flex-align: end;
|
||||||
-ms-grid-row-align: flex-end;
|
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6537,6 +6534,7 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
.flex-xl-middle {
|
.flex-xl-middle {
|
||||||
-webkit-align-self: center;
|
-webkit-align-self: center;
|
||||||
-ms-flex-item-align: center;
|
-ms-flex-item-align: center;
|
||||||
|
-ms-grid-row-align: center;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
.flex-xl-bottom {
|
.flex-xl-bottom {
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1896,7 +1896,7 @@ pre code {
|
||||||
.table-responsive {
|
.table-responsive {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: .01%;
|
min-height: 0%;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2035,10 +2035,11 @@ select.form-control:focus::-ms-value {
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control-static {
|
.form-control-static {
|
||||||
min-height: 2.5rem;
|
|
||||||
padding-top: 0.5rem;
|
padding-top: 0.5rem;
|
||||||
padding-bottom: 0.5rem;
|
padding-bottom: 0.5rem;
|
||||||
margin-bottom: 0;
|
line-height: 1.25;
|
||||||
|
border: solid transparent;
|
||||||
|
border-width: 1px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control-static.form-control-sm, .input-group-sm > .form-control-static.form-control,
|
.form-control-static.form-control-sm, .input-group-sm > .form-control-static.form-control,
|
||||||
|
@ -2162,18 +2163,19 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
border-color: #5cb85c;
|
border-color: #5cb85c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-success .form-control:focus {
|
||||||
|
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #a3d7a3;
|
||||||
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #a3d7a3;
|
||||||
|
}
|
||||||
|
|
||||||
.has-success .input-group-addon {
|
.has-success .input-group-addon {
|
||||||
color: #5cb85c;
|
color: #5cb85c;
|
||||||
border-color: #5cb85c;
|
border-color: #5cb85c;
|
||||||
background-color: #eaf6ea;
|
background-color: #eaf6ea;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-success .form-control-feedback {
|
|
||||||
color: #5cb85c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.has-success .form-control-success {
|
.has-success .form-control-success {
|
||||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='$form-icon-success-color' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#5cb85c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-warning .form-control-feedback,
|
.has-warning .form-control-feedback,
|
||||||
|
@ -2188,16 +2190,17 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
border-color: #f0ad4e;
|
border-color: #f0ad4e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-warning .form-control:focus {
|
||||||
|
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8d9ac;
|
||||||
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8d9ac;
|
||||||
|
}
|
||||||
|
|
||||||
.has-warning .input-group-addon {
|
.has-warning .input-group-addon {
|
||||||
color: #f0ad4e;
|
color: #f0ad4e;
|
||||||
border-color: #f0ad4e;
|
border-color: #f0ad4e;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-warning .form-control-feedback {
|
|
||||||
color: #f0ad4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.has-warning .form-control-warning {
|
.has-warning .form-control-warning {
|
||||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#f0ad4e' d='M4.4 5.324h-.8v-2.46h.8zm0 1.42h-.8V5.89h.8zM3.76.63L.04 7.075c-.115.2.016.425.26.426h7.397c.242 0 .372-.226.258-.426C6.726 4.924 5.47 2.79 4.253.63c-.113-.174-.39-.174-.494 0z'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#f0ad4e' d='M4.4 5.324h-.8v-2.46h.8zm0 1.42h-.8V5.89h.8zM3.76.63L.04 7.075c-.115.2.016.425.26.426h7.397c.242 0 .372-.226.258-.426C6.726 4.924 5.47 2.79 4.253.63c-.113-.174-.39-.174-.494 0z'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
@ -2214,16 +2217,17 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
border-color: #d9534f;
|
border-color: #d9534f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-danger .form-control:focus {
|
||||||
|
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #eba5a3;
|
||||||
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #eba5a3;
|
||||||
|
}
|
||||||
|
|
||||||
.has-danger .input-group-addon {
|
.has-danger .input-group-addon {
|
||||||
color: #d9534f;
|
color: #d9534f;
|
||||||
border-color: #d9534f;
|
border-color: #d9534f;
|
||||||
background-color: #fdf7f7;
|
background-color: #fdf7f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-danger .form-control-feedback {
|
|
||||||
color: #d9534f;
|
|
||||||
}
|
|
||||||
|
|
||||||
.has-danger .form-control-danger {
|
.has-danger .form-control-danger {
|
||||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
@ -2244,6 +2248,7 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
}
|
}
|
||||||
.form-inline .input-group {
|
.form-inline .input-group {
|
||||||
display: inline-table;
|
display: inline-table;
|
||||||
|
width: auto;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.form-inline .input-group .input-group-addon,
|
.form-inline .input-group .input-group-addon,
|
||||||
|
@ -4950,6 +4955,8 @@ base::-moz-progress-bar,
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-group-flush .list-group-item {
|
.list-group-flush .list-group-item {
|
||||||
|
border-right: 0;
|
||||||
|
border-left: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
3784
dist/js/bootstrap.js
3784
dist/js/bootstrap.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2113,7 +2113,7 @@ pre code {
|
||||||
.table-responsive {
|
.table-responsive {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: .01%;
|
min-height: 0%;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2252,10 +2252,11 @@ select.form-control:focus::-ms-value {
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control-static {
|
.form-control-static {
|
||||||
min-height: 2.5rem;
|
|
||||||
padding-top: 0.5rem;
|
padding-top: 0.5rem;
|
||||||
padding-bottom: 0.5rem;
|
padding-bottom: 0.5rem;
|
||||||
margin-bottom: 0;
|
line-height: 1.25;
|
||||||
|
border: solid transparent;
|
||||||
|
border-width: 1px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control-static.form-control-sm, .input-group-sm > .form-control-static.form-control,
|
.form-control-static.form-control-sm, .input-group-sm > .form-control-static.form-control,
|
||||||
|
@ -2379,18 +2380,19 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
border-color: #5cb85c;
|
border-color: #5cb85c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-success .form-control:focus {
|
||||||
|
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #a3d7a3;
|
||||||
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #a3d7a3;
|
||||||
|
}
|
||||||
|
|
||||||
.has-success .input-group-addon {
|
.has-success .input-group-addon {
|
||||||
color: #5cb85c;
|
color: #5cb85c;
|
||||||
border-color: #5cb85c;
|
border-color: #5cb85c;
|
||||||
background-color: #eaf6ea;
|
background-color: #eaf6ea;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-success .form-control-feedback {
|
|
||||||
color: #5cb85c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.has-success .form-control-success {
|
.has-success .form-control-success {
|
||||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='$form-icon-success-color' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#5cb85c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-warning .form-control-feedback,
|
.has-warning .form-control-feedback,
|
||||||
|
@ -2405,16 +2407,17 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
border-color: #f0ad4e;
|
border-color: #f0ad4e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-warning .form-control:focus {
|
||||||
|
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8d9ac;
|
||||||
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8d9ac;
|
||||||
|
}
|
||||||
|
|
||||||
.has-warning .input-group-addon {
|
.has-warning .input-group-addon {
|
||||||
color: #f0ad4e;
|
color: #f0ad4e;
|
||||||
border-color: #f0ad4e;
|
border-color: #f0ad4e;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-warning .form-control-feedback {
|
|
||||||
color: #f0ad4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.has-warning .form-control-warning {
|
.has-warning .form-control-warning {
|
||||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#f0ad4e' d='M4.4 5.324h-.8v-2.46h.8zm0 1.42h-.8V5.89h.8zM3.76.63L.04 7.075c-.115.2.016.425.26.426h7.397c.242 0 .372-.226.258-.426C6.726 4.924 5.47 2.79 4.253.63c-.113-.174-.39-.174-.494 0z'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#f0ad4e' d='M4.4 5.324h-.8v-2.46h.8zm0 1.42h-.8V5.89h.8zM3.76.63L.04 7.075c-.115.2.016.425.26.426h7.397c.242 0 .372-.226.258-.426C6.726 4.924 5.47 2.79 4.253.63c-.113-.174-.39-.174-.494 0z'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
@ -2431,16 +2434,17 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
border-color: #d9534f;
|
border-color: #d9534f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-danger .form-control:focus {
|
||||||
|
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #eba5a3;
|
||||||
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #eba5a3;
|
||||||
|
}
|
||||||
|
|
||||||
.has-danger .input-group-addon {
|
.has-danger .input-group-addon {
|
||||||
color: #d9534f;
|
color: #d9534f;
|
||||||
border-color: #d9534f;
|
border-color: #d9534f;
|
||||||
background-color: #fdf7f7;
|
background-color: #fdf7f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-danger .form-control-feedback {
|
|
||||||
color: #d9534f;
|
|
||||||
}
|
|
||||||
|
|
||||||
.has-danger .form-control-danger {
|
.has-danger .form-control-danger {
|
||||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
@ -2461,6 +2465,7 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
}
|
}
|
||||||
.form-inline .input-group {
|
.form-inline .input-group {
|
||||||
display: inline-table;
|
display: inline-table;
|
||||||
|
width: auto;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.form-inline .input-group .input-group-addon,
|
.form-inline .input-group .input-group-addon,
|
||||||
|
@ -5080,6 +5085,7 @@ base::-moz-progress-bar,
|
||||||
.media-middle {
|
.media-middle {
|
||||||
-webkit-align-self: center;
|
-webkit-align-self: center;
|
||||||
-ms-flex-item-align: center;
|
-ms-flex-item-align: center;
|
||||||
|
-ms-grid-row-align: center;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5177,6 +5183,8 @@ base::-moz-progress-bar,
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-group-flush .list-group-item {
|
.list-group-flush .list-group-item {
|
||||||
|
border-right: 0;
|
||||||
|
border-left: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6126,7 +6134,6 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: start;
|
-webkit-box-align: start;
|
||||||
-webkit-align-items: flex-start;
|
-webkit-align-items: flex-start;
|
||||||
-ms-flex-align: start;
|
-ms-flex-align: start;
|
||||||
-ms-grid-row-align: flex-start;
|
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6134,7 +6141,6 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: center;
|
-webkit-box-align: center;
|
||||||
-webkit-align-items: center;
|
-webkit-align-items: center;
|
||||||
-ms-flex-align: center;
|
-ms-flex-align: center;
|
||||||
-ms-grid-row-align: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6142,7 +6148,6 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: end;
|
-webkit-box-align: end;
|
||||||
-webkit-align-items: flex-end;
|
-webkit-align-items: flex-end;
|
||||||
-ms-flex-align: end;
|
-ms-flex-align: end;
|
||||||
-ms-grid-row-align: flex-end;
|
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6155,6 +6160,7 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
.flex-xs-middle {
|
.flex-xs-middle {
|
||||||
-webkit-align-self: center;
|
-webkit-align-self: center;
|
||||||
-ms-flex-item-align: center;
|
-ms-flex-item-align: center;
|
||||||
|
-ms-grid-row-align: center;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6224,21 +6230,18 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: start;
|
-webkit-box-align: start;
|
||||||
-webkit-align-items: flex-start;
|
-webkit-align-items: flex-start;
|
||||||
-ms-flex-align: start;
|
-ms-flex-align: start;
|
||||||
-ms-grid-row-align: flex-start;
|
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
.flex-items-sm-middle {
|
.flex-items-sm-middle {
|
||||||
-webkit-box-align: center;
|
-webkit-box-align: center;
|
||||||
-webkit-align-items: center;
|
-webkit-align-items: center;
|
||||||
-ms-flex-align: center;
|
-ms-flex-align: center;
|
||||||
-ms-grid-row-align: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.flex-items-sm-bottom {
|
.flex-items-sm-bottom {
|
||||||
-webkit-box-align: end;
|
-webkit-box-align: end;
|
||||||
-webkit-align-items: flex-end;
|
-webkit-align-items: flex-end;
|
||||||
-ms-flex-align: end;
|
-ms-flex-align: end;
|
||||||
-ms-grid-row-align: flex-end;
|
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6252,6 +6255,7 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
.flex-sm-middle {
|
.flex-sm-middle {
|
||||||
-webkit-align-self: center;
|
-webkit-align-self: center;
|
||||||
-ms-flex-item-align: center;
|
-ms-flex-item-align: center;
|
||||||
|
-ms-grid-row-align: center;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
.flex-sm-bottom {
|
.flex-sm-bottom {
|
||||||
|
@ -6319,21 +6323,18 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: start;
|
-webkit-box-align: start;
|
||||||
-webkit-align-items: flex-start;
|
-webkit-align-items: flex-start;
|
||||||
-ms-flex-align: start;
|
-ms-flex-align: start;
|
||||||
-ms-grid-row-align: flex-start;
|
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
.flex-items-md-middle {
|
.flex-items-md-middle {
|
||||||
-webkit-box-align: center;
|
-webkit-box-align: center;
|
||||||
-webkit-align-items: center;
|
-webkit-align-items: center;
|
||||||
-ms-flex-align: center;
|
-ms-flex-align: center;
|
||||||
-ms-grid-row-align: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.flex-items-md-bottom {
|
.flex-items-md-bottom {
|
||||||
-webkit-box-align: end;
|
-webkit-box-align: end;
|
||||||
-webkit-align-items: flex-end;
|
-webkit-align-items: flex-end;
|
||||||
-ms-flex-align: end;
|
-ms-flex-align: end;
|
||||||
-ms-grid-row-align: flex-end;
|
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6347,6 +6348,7 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
.flex-md-middle {
|
.flex-md-middle {
|
||||||
-webkit-align-self: center;
|
-webkit-align-self: center;
|
||||||
-ms-flex-item-align: center;
|
-ms-flex-item-align: center;
|
||||||
|
-ms-grid-row-align: center;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
.flex-md-bottom {
|
.flex-md-bottom {
|
||||||
|
@ -6414,21 +6416,18 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: start;
|
-webkit-box-align: start;
|
||||||
-webkit-align-items: flex-start;
|
-webkit-align-items: flex-start;
|
||||||
-ms-flex-align: start;
|
-ms-flex-align: start;
|
||||||
-ms-grid-row-align: flex-start;
|
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
.flex-items-lg-middle {
|
.flex-items-lg-middle {
|
||||||
-webkit-box-align: center;
|
-webkit-box-align: center;
|
||||||
-webkit-align-items: center;
|
-webkit-align-items: center;
|
||||||
-ms-flex-align: center;
|
-ms-flex-align: center;
|
||||||
-ms-grid-row-align: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.flex-items-lg-bottom {
|
.flex-items-lg-bottom {
|
||||||
-webkit-box-align: end;
|
-webkit-box-align: end;
|
||||||
-webkit-align-items: flex-end;
|
-webkit-align-items: flex-end;
|
||||||
-ms-flex-align: end;
|
-ms-flex-align: end;
|
||||||
-ms-grid-row-align: flex-end;
|
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6442,6 +6441,7 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
.flex-lg-middle {
|
.flex-lg-middle {
|
||||||
-webkit-align-self: center;
|
-webkit-align-self: center;
|
||||||
-ms-flex-item-align: center;
|
-ms-flex-item-align: center;
|
||||||
|
-ms-grid-row-align: center;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
.flex-lg-bottom {
|
.flex-lg-bottom {
|
||||||
|
@ -6509,21 +6509,18 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
-webkit-box-align: start;
|
-webkit-box-align: start;
|
||||||
-webkit-align-items: flex-start;
|
-webkit-align-items: flex-start;
|
||||||
-ms-flex-align: start;
|
-ms-flex-align: start;
|
||||||
-ms-grid-row-align: flex-start;
|
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
.flex-items-xl-middle {
|
.flex-items-xl-middle {
|
||||||
-webkit-box-align: center;
|
-webkit-box-align: center;
|
||||||
-webkit-align-items: center;
|
-webkit-align-items: center;
|
||||||
-ms-flex-align: center;
|
-ms-flex-align: center;
|
||||||
-ms-grid-row-align: center;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.flex-items-xl-bottom {
|
.flex-items-xl-bottom {
|
||||||
-webkit-box-align: end;
|
-webkit-box-align: end;
|
||||||
-webkit-align-items: flex-end;
|
-webkit-align-items: flex-end;
|
||||||
-ms-flex-align: end;
|
-ms-flex-align: end;
|
||||||
-ms-grid-row-align: flex-end;
|
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6537,6 +6534,7 @@ a.bg-inverse:focus, a.bg-inverse:hover {
|
||||||
.flex-xl-middle {
|
.flex-xl-middle {
|
||||||
-webkit-align-self: center;
|
-webkit-align-self: center;
|
||||||
-ms-flex-item-align: center;
|
-ms-flex-item-align: center;
|
||||||
|
-ms-grid-row-align: center;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
.flex-xl-bottom {
|
.flex-xl-bottom {
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1896,7 +1896,7 @@ pre code {
|
||||||
.table-responsive {
|
.table-responsive {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: .01%;
|
min-height: 0%;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2035,10 +2035,11 @@ select.form-control:focus::-ms-value {
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control-static {
|
.form-control-static {
|
||||||
min-height: 2.5rem;
|
|
||||||
padding-top: 0.5rem;
|
padding-top: 0.5rem;
|
||||||
padding-bottom: 0.5rem;
|
padding-bottom: 0.5rem;
|
||||||
margin-bottom: 0;
|
line-height: 1.25;
|
||||||
|
border: solid transparent;
|
||||||
|
border-width: 1px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control-static.form-control-sm, .input-group-sm > .form-control-static.form-control,
|
.form-control-static.form-control-sm, .input-group-sm > .form-control-static.form-control,
|
||||||
|
@ -2162,18 +2163,19 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
border-color: #5cb85c;
|
border-color: #5cb85c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-success .form-control:focus {
|
||||||
|
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #a3d7a3;
|
||||||
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #a3d7a3;
|
||||||
|
}
|
||||||
|
|
||||||
.has-success .input-group-addon {
|
.has-success .input-group-addon {
|
||||||
color: #5cb85c;
|
color: #5cb85c;
|
||||||
border-color: #5cb85c;
|
border-color: #5cb85c;
|
||||||
background-color: #eaf6ea;
|
background-color: #eaf6ea;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-success .form-control-feedback {
|
|
||||||
color: #5cb85c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.has-success .form-control-success {
|
.has-success .form-control-success {
|
||||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='$form-icon-success-color' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#5cb85c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-warning .form-control-feedback,
|
.has-warning .form-control-feedback,
|
||||||
|
@ -2188,16 +2190,17 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
border-color: #f0ad4e;
|
border-color: #f0ad4e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-warning .form-control:focus {
|
||||||
|
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8d9ac;
|
||||||
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8d9ac;
|
||||||
|
}
|
||||||
|
|
||||||
.has-warning .input-group-addon {
|
.has-warning .input-group-addon {
|
||||||
color: #f0ad4e;
|
color: #f0ad4e;
|
||||||
border-color: #f0ad4e;
|
border-color: #f0ad4e;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-warning .form-control-feedback {
|
|
||||||
color: #f0ad4e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.has-warning .form-control-warning {
|
.has-warning .form-control-warning {
|
||||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#f0ad4e' d='M4.4 5.324h-.8v-2.46h.8zm0 1.42h-.8V5.89h.8zM3.76.63L.04 7.075c-.115.2.016.425.26.426h7.397c.242 0 .372-.226.258-.426C6.726 4.924 5.47 2.79 4.253.63c-.113-.174-.39-.174-.494 0z'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#f0ad4e' d='M4.4 5.324h-.8v-2.46h.8zm0 1.42h-.8V5.89h.8zM3.76.63L.04 7.075c-.115.2.016.425.26.426h7.397c.242 0 .372-.226.258-.426C6.726 4.924 5.47 2.79 4.253.63c-.113-.174-.39-.174-.494 0z'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
@ -2214,16 +2217,17 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
border-color: #d9534f;
|
border-color: #d9534f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-danger .form-control:focus {
|
||||||
|
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #eba5a3;
|
||||||
|
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #eba5a3;
|
||||||
|
}
|
||||||
|
|
||||||
.has-danger .input-group-addon {
|
.has-danger .input-group-addon {
|
||||||
color: #d9534f;
|
color: #d9534f;
|
||||||
border-color: #d9534f;
|
border-color: #d9534f;
|
||||||
background-color: #fdf7f7;
|
background-color: #fdf7f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-danger .form-control-feedback {
|
|
||||||
color: #d9534f;
|
|
||||||
}
|
|
||||||
|
|
||||||
.has-danger .form-control-danger {
|
.has-danger .form-control-danger {
|
||||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
@ -2244,6 +2248,7 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for
|
||||||
}
|
}
|
||||||
.form-inline .input-group {
|
.form-inline .input-group {
|
||||||
display: inline-table;
|
display: inline-table;
|
||||||
|
width: auto;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.form-inline .input-group .input-group-addon,
|
.form-inline .input-group .input-group-addon,
|
||||||
|
@ -4950,6 +4955,8 @@ base::-moz-progress-bar,
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-group-flush .list-group-item {
|
.list-group-flush .list-group-item {
|
||||||
|
border-right: 0;
|
||||||
|
border-left: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,8 +1,6 @@
|
||||||
'use strict';
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||||
|
|
||||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
|
@ -11,7 +9,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Alert = (function ($) {
|
var Alert = function ($) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
@ -49,120 +47,103 @@ var Alert = (function ($) {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Alert = (function () {
|
var Alert = function () {
|
||||||
function Alert(element) {
|
function Alert(element) {
|
||||||
_classCallCheck(this, Alert);
|
_classCallCheck(this, Alert);
|
||||||
|
|
||||||
this._element = element;
|
this._element = element;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Data Api implementation
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
|
|
||||||
_createClass(Alert, [{
|
// public
|
||||||
key: 'close',
|
|
||||||
|
|
||||||
// public
|
Alert.prototype.close = function close(element) {
|
||||||
|
element = element || this._element;
|
||||||
|
|
||||||
value: function close(element) {
|
var rootElement = this._getRootElement(element);
|
||||||
element = element || this._element;
|
var customEvent = this._triggerCloseEvent(rootElement);
|
||||||
|
|
||||||
var rootElement = this._getRootElement(element);
|
if (customEvent.isDefaultPrevented()) {
|
||||||
var customEvent = this._triggerCloseEvent(rootElement);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (customEvent.isDefaultPrevented()) {
|
this._removeElement(rootElement);
|
||||||
return;
|
};
|
||||||
|
|
||||||
|
Alert.prototype.dispose = function dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY);
|
||||||
|
this._element = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
// private
|
||||||
|
|
||||||
|
Alert.prototype._getRootElement = function _getRootElement(element) {
|
||||||
|
var selector = Util.getSelectorFromElement(element);
|
||||||
|
var parent = false;
|
||||||
|
|
||||||
|
if (selector) {
|
||||||
|
parent = $(selector)[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!parent) {
|
||||||
|
parent = $(element).closest('.' + ClassName.ALERT)[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent;
|
||||||
|
};
|
||||||
|
|
||||||
|
Alert.prototype._triggerCloseEvent = function _triggerCloseEvent(element) {
|
||||||
|
var closeEvent = $.Event(Event.CLOSE);
|
||||||
|
|
||||||
|
$(element).trigger(closeEvent);
|
||||||
|
return closeEvent;
|
||||||
|
};
|
||||||
|
|
||||||
|
Alert.prototype._removeElement = function _removeElement(element) {
|
||||||
|
$(element).removeClass(ClassName.IN);
|
||||||
|
|
||||||
|
if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) {
|
||||||
|
this._destroyElement(element);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(element).one(Util.TRANSITION_END, $.proxy(this._destroyElement, this, element)).emulateTransitionEnd(TRANSITION_DURATION);
|
||||||
|
};
|
||||||
|
|
||||||
|
Alert.prototype._destroyElement = function _destroyElement(element) {
|
||||||
|
$(element).detach().trigger(Event.CLOSED).remove();
|
||||||
|
};
|
||||||
|
|
||||||
|
// static
|
||||||
|
|
||||||
|
Alert._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $element = $(this);
|
||||||
|
var data = $element.data(DATA_KEY);
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Alert(this);
|
||||||
|
$element.data(DATA_KEY, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._removeElement(rootElement);
|
if (config === 'close') {
|
||||||
}
|
data[config](this);
|
||||||
}, {
|
}
|
||||||
key: 'dispose',
|
});
|
||||||
value: function dispose() {
|
};
|
||||||
$.removeData(this._element, DATA_KEY);
|
|
||||||
this._element = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// private
|
Alert._handleDismiss = function _handleDismiss(alertInstance) {
|
||||||
|
return function (event) {
|
||||||
}, {
|
if (event) {
|
||||||
key: '_getRootElement',
|
event.preventDefault();
|
||||||
value: function _getRootElement(element) {
|
|
||||||
var selector = Util.getSelectorFromElement(element);
|
|
||||||
var parent = false;
|
|
||||||
|
|
||||||
if (selector) {
|
|
||||||
parent = $(selector)[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!parent) {
|
alertInstance.close(this);
|
||||||
parent = $(element).closest('.' + ClassName.ALERT)[0];
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
return parent;
|
_createClass(Alert, null, [{
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_triggerCloseEvent',
|
|
||||||
value: function _triggerCloseEvent(element) {
|
|
||||||
var closeEvent = $.Event(Event.CLOSE);
|
|
||||||
|
|
||||||
$(element).trigger(closeEvent);
|
|
||||||
return closeEvent;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_removeElement',
|
|
||||||
value: function _removeElement(element) {
|
|
||||||
$(element).removeClass(ClassName.IN);
|
|
||||||
|
|
||||||
if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) {
|
|
||||||
this._destroyElement(element);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$(element).one(Util.TRANSITION_END, $.proxy(this._destroyElement, this, element)).emulateTransitionEnd(TRANSITION_DURATION);
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_destroyElement',
|
|
||||||
value: function _destroyElement(element) {
|
|
||||||
$(element).detach().trigger(Event.CLOSED).remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
|
||||||
|
|
||||||
}], [{
|
|
||||||
key: '_jQueryInterface',
|
|
||||||
value: function _jQueryInterface(config) {
|
|
||||||
return this.each(function () {
|
|
||||||
var $element = $(this);
|
|
||||||
var data = $element.data(DATA_KEY);
|
|
||||||
|
|
||||||
if (!data) {
|
|
||||||
data = new Alert(this);
|
|
||||||
$element.data(DATA_KEY, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config === 'close') {
|
|
||||||
data[config](this);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_handleDismiss',
|
|
||||||
value: function _handleDismiss(alertInstance) {
|
|
||||||
return function (event) {
|
|
||||||
if (event) {
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
alertInstance.close(this);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'VERSION',
|
key: 'VERSION',
|
||||||
get: function get() {
|
get: function get() {
|
||||||
return VERSION;
|
return VERSION;
|
||||||
|
@ -170,7 +151,13 @@ var Alert = (function ($) {
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return Alert;
|
return Alert;
|
||||||
})();
|
}();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
|
$(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
|
||||||
|
|
||||||
|
@ -188,5 +175,5 @@ var Alert = (function ($) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return Alert;
|
return Alert;
|
||||||
})(jQuery);
|
}(jQuery);
|
||||||
//# sourceMappingURL=alert.js.map
|
//# sourceMappingURL=alert.js.map
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,7 @@
|
||||||
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.0.0-alpha.4): button.js
|
* Bootstrap (v4.0.0-alpha.4): button.js
|
||||||
|
@ -5,13 +9,7 @@
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
var Button = function ($) {
|
||||||
|
|
||||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
|
||||||
|
|
||||||
var Button = (function ($) {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
@ -51,87 +49,76 @@ var Button = (function ($) {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Button = (function () {
|
var Button = function () {
|
||||||
function Button(element) {
|
function Button(element) {
|
||||||
_classCallCheck(this, Button);
|
_classCallCheck(this, Button);
|
||||||
|
|
||||||
this._element = element;
|
this._element = element;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Data Api implementation
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
|
|
||||||
_createClass(Button, [{
|
// public
|
||||||
key: 'toggle',
|
|
||||||
|
|
||||||
// public
|
Button.prototype.toggle = function toggle() {
|
||||||
|
var triggerChangeEvent = true;
|
||||||
|
var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
|
||||||
|
|
||||||
value: function toggle() {
|
if (rootElement) {
|
||||||
var triggerChangeEvent = true;
|
var input = $(this._element).find(Selector.INPUT)[0];
|
||||||
var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
|
|
||||||
|
|
||||||
if (rootElement) {
|
if (input) {
|
||||||
var input = $(this._element).find(Selector.INPUT)[0];
|
if (input.type === 'radio') {
|
||||||
|
if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) {
|
||||||
|
triggerChangeEvent = false;
|
||||||
|
} else {
|
||||||
|
var activeElement = $(rootElement).find(Selector.ACTIVE)[0];
|
||||||
|
|
||||||
if (input) {
|
if (activeElement) {
|
||||||
if (input.type === 'radio') {
|
$(activeElement).removeClass(ClassName.ACTIVE);
|
||||||
if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) {
|
|
||||||
triggerChangeEvent = false;
|
|
||||||
} else {
|
|
||||||
var activeElement = $(rootElement).find(Selector.ACTIVE)[0];
|
|
||||||
|
|
||||||
if (activeElement) {
|
|
||||||
$(activeElement).removeClass(ClassName.ACTIVE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (triggerChangeEvent) {
|
|
||||||
input.checked = !$(this._element).hasClass(ClassName.ACTIVE);
|
|
||||||
$(this._element).trigger('change');
|
|
||||||
}
|
|
||||||
|
|
||||||
input.focus();
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
|
if (triggerChangeEvent) {
|
||||||
|
input.checked = !$(this._element).hasClass(ClassName.ACTIVE);
|
||||||
|
$(this._element).trigger('change');
|
||||||
|
}
|
||||||
|
|
||||||
|
input.focus();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (triggerChangeEvent) {
|
||||||
|
$(this._element).toggleClass(ClassName.ACTIVE);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Button.prototype.dispose = function dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY);
|
||||||
|
this._element = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
// static
|
||||||
|
|
||||||
|
Button._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var data = $(this).data(DATA_KEY);
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Button(this);
|
||||||
|
$(this).data(DATA_KEY, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (triggerChangeEvent) {
|
if (config === 'toggle') {
|
||||||
$(this._element).toggleClass(ClassName.ACTIVE);
|
data[config]();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}, {
|
};
|
||||||
key: 'dispose',
|
|
||||||
value: function dispose() {
|
|
||||||
$.removeData(this._element, DATA_KEY);
|
|
||||||
this._element = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
_createClass(Button, null, [{
|
||||||
|
|
||||||
}], [{
|
|
||||||
key: '_jQueryInterface',
|
|
||||||
value: function _jQueryInterface(config) {
|
|
||||||
return this.each(function () {
|
|
||||||
var data = $(this).data(DATA_KEY);
|
|
||||||
|
|
||||||
if (!data) {
|
|
||||||
data = new Button(this);
|
|
||||||
$(this).data(DATA_KEY, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config === 'toggle') {
|
|
||||||
data[config]();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'VERSION',
|
key: 'VERSION',
|
||||||
get: function get() {
|
get: function get() {
|
||||||
return VERSION;
|
return VERSION;
|
||||||
|
@ -139,7 +126,13 @@ var Button = (function ($) {
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return Button;
|
return Button;
|
||||||
})();
|
}();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
|
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -170,5 +163,5 @@ var Button = (function ($) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return Button;
|
return Button;
|
||||||
})(jQuery);
|
}(jQuery);
|
||||||
//# sourceMappingURL=button.js.map
|
//# sourceMappingURL=button.js.map
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,8 +1,8 @@
|
||||||
'use strict';
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||||
|
|
||||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
|
@ -11,7 +11,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Carousel = (function ($) {
|
var Carousel = function ($) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
@ -85,7 +85,7 @@ var Carousel = (function ($) {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Carousel = (function () {
|
var Carousel = function () {
|
||||||
function Carousel(element, config) {
|
function Carousel(element, config) {
|
||||||
_classCallCheck(this, Carousel);
|
_classCallCheck(this, Carousel);
|
||||||
|
|
||||||
|
@ -103,344 +103,318 @@ var Carousel = (function ($) {
|
||||||
this._addEventListeners();
|
this._addEventListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Data Api implementation
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
|
|
||||||
_createClass(Carousel, [{
|
// public
|
||||||
key: 'next',
|
|
||||||
|
|
||||||
// public
|
Carousel.prototype.next = function next() {
|
||||||
|
if (!this._isSliding) {
|
||||||
value: function next() {
|
this._slide(Direction.NEXT);
|
||||||
if (!this._isSliding) {
|
|
||||||
this._slide(Direction.NEXT);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, {
|
};
|
||||||
key: 'nextWhenVisible',
|
|
||||||
value: function nextWhenVisible() {
|
|
||||||
// Don't call next when the page isn't visible
|
|
||||||
if (!document.hidden) {
|
|
||||||
this.next();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'prev',
|
|
||||||
value: function prev() {
|
|
||||||
if (!this._isSliding) {
|
|
||||||
this._slide(Direction.PREVIOUS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'pause',
|
|
||||||
value: function pause(event) {
|
|
||||||
if (!event) {
|
|
||||||
this._isPaused = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) {
|
Carousel.prototype.nextWhenVisible = function nextWhenVisible() {
|
||||||
Util.triggerTransitionEnd(this._element);
|
// Don't call next when the page isn't visible
|
||||||
this.cycle(true);
|
if (!document.hidden) {
|
||||||
}
|
this.next();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Carousel.prototype.prev = function prev() {
|
||||||
|
if (!this._isSliding) {
|
||||||
|
this._slide(Direction.PREVIOUS);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Carousel.prototype.pause = function pause(event) {
|
||||||
|
if (!event) {
|
||||||
|
this._isPaused = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) {
|
||||||
|
Util.triggerTransitionEnd(this._element);
|
||||||
|
this.cycle(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
clearInterval(this._interval);
|
||||||
|
this._interval = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
Carousel.prototype.cycle = function cycle(event) {
|
||||||
|
if (!event) {
|
||||||
|
this._isPaused = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._interval) {
|
||||||
clearInterval(this._interval);
|
clearInterval(this._interval);
|
||||||
this._interval = null;
|
this._interval = null;
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
key: 'cycle',
|
|
||||||
value: function cycle(event) {
|
|
||||||
if (!event) {
|
|
||||||
this._isPaused = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._interval) {
|
if (this._config.interval && !this._isPaused) {
|
||||||
clearInterval(this._interval);
|
this._interval = setInterval($.proxy(document.visibilityState ? this.nextWhenVisible : this.next, this), this._config.interval);
|
||||||
this._interval = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._config.interval && !this._isPaused) {
|
|
||||||
this._interval = setInterval($.proxy(document.visibilityState ? this.nextWhenVisible : this.next, this), this._config.interval);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, {
|
};
|
||||||
key: 'to',
|
|
||||||
value: function to(index) {
|
|
||||||
var _this = this;
|
|
||||||
|
|
||||||
this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
|
Carousel.prototype.to = function to(index) {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
var activeIndex = this._getItemIndex(this._activeElement);
|
this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
|
||||||
|
|
||||||
if (index > this._items.length - 1 || index < 0) {
|
var activeIndex = this._getItemIndex(this._activeElement);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._isSliding) {
|
if (index > this._items.length - 1 || index < 0) {
|
||||||
$(this._element).one(Event.SLID, function () {
|
return;
|
||||||
return _this.to(index);
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activeIndex === index) {
|
|
||||||
this.pause();
|
|
||||||
this.cycle();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS;
|
|
||||||
|
|
||||||
this._slide(direction, this._items[index]);
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'dispose',
|
|
||||||
value: function dispose() {
|
|
||||||
$(this._element).off(EVENT_KEY);
|
|
||||||
$.removeData(this._element, DATA_KEY);
|
|
||||||
|
|
||||||
this._items = null;
|
|
||||||
this._config = null;
|
|
||||||
this._element = null;
|
|
||||||
this._interval = null;
|
|
||||||
this._isPaused = null;
|
|
||||||
this._isSliding = null;
|
|
||||||
this._activeElement = null;
|
|
||||||
this._indicatorsElement = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// private
|
if (this._isSliding) {
|
||||||
|
$(this._element).one(Event.SLID, function () {
|
||||||
}, {
|
return _this.to(index);
|
||||||
key: '_getConfig',
|
|
||||||
value: function _getConfig(config) {
|
|
||||||
config = $.extend({}, Default, config);
|
|
||||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
|
||||||
return config;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_addEventListeners',
|
|
||||||
value: function _addEventListeners() {
|
|
||||||
if (this._config.keyboard) {
|
|
||||||
$(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) {
|
|
||||||
$(this._element).on(Event.MOUSEENTER, $.proxy(this.pause, this)).on(Event.MOUSELEAVE, $.proxy(this.cycle, this));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_keydown',
|
|
||||||
value: function _keydown(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
if (/input|textarea/i.test(event.target.tagName)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (event.which) {
|
|
||||||
case ARROW_LEFT_KEYCODE:
|
|
||||||
this.prev();
|
|
||||||
break;
|
|
||||||
case ARROW_RIGHT_KEYCODE:
|
|
||||||
this.next();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_getItemIndex',
|
|
||||||
value: function _getItemIndex(element) {
|
|
||||||
this._items = $.makeArray($(element).parent().find(Selector.ITEM));
|
|
||||||
return this._items.indexOf(element);
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_getItemByDirection',
|
|
||||||
value: function _getItemByDirection(direction, activeElement) {
|
|
||||||
var isNextDirection = direction === Direction.NEXT;
|
|
||||||
var isPrevDirection = direction === Direction.PREVIOUS;
|
|
||||||
var activeIndex = this._getItemIndex(activeElement);
|
|
||||||
var lastItemIndex = this._items.length - 1;
|
|
||||||
var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
|
|
||||||
|
|
||||||
if (isGoingToWrap && !this._config.wrap) {
|
|
||||||
return activeElement;
|
|
||||||
}
|
|
||||||
|
|
||||||
var delta = direction === Direction.PREVIOUS ? -1 : 1;
|
|
||||||
var itemIndex = (activeIndex + delta) % this._items.length;
|
|
||||||
|
|
||||||
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_triggerSlideEvent',
|
|
||||||
value: function _triggerSlideEvent(relatedTarget, directionalClassname) {
|
|
||||||
var slideEvent = $.Event(Event.SLIDE, {
|
|
||||||
relatedTarget: relatedTarget,
|
|
||||||
direction: directionalClassname
|
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
$(this._element).trigger(slideEvent);
|
|
||||||
|
|
||||||
return slideEvent;
|
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
key: '_setActiveIndicatorElement',
|
|
||||||
value: function _setActiveIndicatorElement(element) {
|
|
||||||
if (this._indicatorsElement) {
|
|
||||||
$(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
|
|
||||||
|
|
||||||
var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
|
if (activeIndex === index) {
|
||||||
|
this.pause();
|
||||||
|
this.cycle();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (nextIndicator) {
|
var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS;
|
||||||
$(nextIndicator).addClass(ClassName.ACTIVE);
|
|
||||||
}
|
this._slide(direction, this._items[index]);
|
||||||
|
};
|
||||||
|
|
||||||
|
Carousel.prototype.dispose = function dispose() {
|
||||||
|
$(this._element).off(EVENT_KEY);
|
||||||
|
$.removeData(this._element, DATA_KEY);
|
||||||
|
|
||||||
|
this._items = null;
|
||||||
|
this._config = null;
|
||||||
|
this._element = null;
|
||||||
|
this._interval = null;
|
||||||
|
this._isPaused = null;
|
||||||
|
this._isSliding = null;
|
||||||
|
this._activeElement = null;
|
||||||
|
this._indicatorsElement = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
// private
|
||||||
|
|
||||||
|
Carousel.prototype._getConfig = function _getConfig(config) {
|
||||||
|
config = $.extend({}, Default, config);
|
||||||
|
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
Carousel.prototype._addEventListeners = function _addEventListeners() {
|
||||||
|
if (this._config.keyboard) {
|
||||||
|
$(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) {
|
||||||
|
$(this._element).on(Event.MOUSEENTER, $.proxy(this.pause, this)).on(Event.MOUSELEAVE, $.proxy(this.cycle, this));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Carousel.prototype._keydown = function _keydown(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
if (/input|textarea/i.test(event.target.tagName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (event.which) {
|
||||||
|
case ARROW_LEFT_KEYCODE:
|
||||||
|
this.prev();
|
||||||
|
break;
|
||||||
|
case ARROW_RIGHT_KEYCODE:
|
||||||
|
this.next();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Carousel.prototype._getItemIndex = function _getItemIndex(element) {
|
||||||
|
this._items = $.makeArray($(element).parent().find(Selector.ITEM));
|
||||||
|
return this._items.indexOf(element);
|
||||||
|
};
|
||||||
|
|
||||||
|
Carousel.prototype._getItemByDirection = function _getItemByDirection(direction, activeElement) {
|
||||||
|
var isNextDirection = direction === Direction.NEXT;
|
||||||
|
var isPrevDirection = direction === Direction.PREVIOUS;
|
||||||
|
var activeIndex = this._getItemIndex(activeElement);
|
||||||
|
var lastItemIndex = this._items.length - 1;
|
||||||
|
var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
|
||||||
|
|
||||||
|
if (isGoingToWrap && !this._config.wrap) {
|
||||||
|
return activeElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
var delta = direction === Direction.PREVIOUS ? -1 : 1;
|
||||||
|
var itemIndex = (activeIndex + delta) % this._items.length;
|
||||||
|
|
||||||
|
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
|
||||||
|
};
|
||||||
|
|
||||||
|
Carousel.prototype._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, directionalClassname) {
|
||||||
|
var slideEvent = $.Event(Event.SLIDE, {
|
||||||
|
relatedTarget: relatedTarget,
|
||||||
|
direction: directionalClassname
|
||||||
|
});
|
||||||
|
|
||||||
|
$(this._element).trigger(slideEvent);
|
||||||
|
|
||||||
|
return slideEvent;
|
||||||
|
};
|
||||||
|
|
||||||
|
Carousel.prototype._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
|
||||||
|
if (this._indicatorsElement) {
|
||||||
|
$(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
|
||||||
|
|
||||||
|
var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
|
||||||
|
|
||||||
|
if (nextIndicator) {
|
||||||
|
$(nextIndicator).addClass(ClassName.ACTIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
};
|
||||||
key: '_slide',
|
|
||||||
value: function _slide(direction, element) {
|
|
||||||
var _this2 = this;
|
|
||||||
|
|
||||||
var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
|
Carousel.prototype._slide = function _slide(direction, element) {
|
||||||
var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
|
var _this2 = this;
|
||||||
|
|
||||||
var isCycling = Boolean(this._interval);
|
var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
|
||||||
|
var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
|
||||||
|
|
||||||
var directionalClassName = direction === Direction.NEXT ? ClassName.LEFT : ClassName.RIGHT;
|
var isCycling = Boolean(this._interval);
|
||||||
|
|
||||||
if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
|
var directionalClassName = direction === Direction.NEXT ? ClassName.LEFT : ClassName.RIGHT;
|
||||||
this._isSliding = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var slideEvent = this._triggerSlideEvent(nextElement, directionalClassName);
|
if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
|
||||||
if (slideEvent.isDefaultPrevented()) {
|
this._isSliding = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!activeElement || !nextElement) {
|
var slideEvent = this._triggerSlideEvent(nextElement, directionalClassName);
|
||||||
// some weirdness is happening, so we bail
|
if (slideEvent.isDefaultPrevented()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._isSliding = true;
|
if (!activeElement || !nextElement) {
|
||||||
|
// some weirdness is happening, so we bail
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isCycling) {
|
this._isSliding = true;
|
||||||
this.pause();
|
|
||||||
}
|
|
||||||
|
|
||||||
this._setActiveIndicatorElement(nextElement);
|
if (isCycling) {
|
||||||
|
this.pause();
|
||||||
|
}
|
||||||
|
|
||||||
var slidEvent = $.Event(Event.SLID, {
|
this._setActiveIndicatorElement(nextElement);
|
||||||
relatedTarget: nextElement,
|
|
||||||
direction: directionalClassName
|
|
||||||
});
|
|
||||||
|
|
||||||
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) {
|
var slidEvent = $.Event(Event.SLID, {
|
||||||
|
relatedTarget: nextElement,
|
||||||
|
direction: directionalClassName
|
||||||
|
});
|
||||||
|
|
||||||
$(nextElement).addClass(direction);
|
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) {
|
||||||
|
|
||||||
Util.reflow(nextElement);
|
$(nextElement).addClass(direction);
|
||||||
|
|
||||||
$(activeElement).addClass(directionalClassName);
|
Util.reflow(nextElement);
|
||||||
$(nextElement).addClass(directionalClassName);
|
|
||||||
|
|
||||||
$(activeElement).one(Util.TRANSITION_END, function () {
|
$(activeElement).addClass(directionalClassName);
|
||||||
$(nextElement).removeClass(directionalClassName).removeClass(direction);
|
$(nextElement).addClass(directionalClassName);
|
||||||
|
|
||||||
$(nextElement).addClass(ClassName.ACTIVE);
|
$(activeElement).one(Util.TRANSITION_END, function () {
|
||||||
|
$(nextElement).removeClass(directionalClassName).removeClass(direction);
|
||||||
|
|
||||||
$(activeElement).removeClass(ClassName.ACTIVE).removeClass(direction).removeClass(directionalClassName);
|
|
||||||
|
|
||||||
_this2._isSliding = false;
|
|
||||||
|
|
||||||
setTimeout(function () {
|
|
||||||
return $(_this2._element).trigger(slidEvent);
|
|
||||||
}, 0);
|
|
||||||
}).emulateTransitionEnd(TRANSITION_DURATION);
|
|
||||||
} else {
|
|
||||||
$(activeElement).removeClass(ClassName.ACTIVE);
|
|
||||||
$(nextElement).addClass(ClassName.ACTIVE);
|
$(nextElement).addClass(ClassName.ACTIVE);
|
||||||
|
|
||||||
this._isSliding = false;
|
$(activeElement).removeClass(ClassName.ACTIVE).removeClass(direction).removeClass(directionalClassName);
|
||||||
$(this._element).trigger(slidEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isCycling) {
|
_this2._isSliding = false;
|
||||||
this.cycle();
|
|
||||||
}
|
setTimeout(function () {
|
||||||
|
return $(_this2._element).trigger(slidEvent);
|
||||||
|
}, 0);
|
||||||
|
}).emulateTransitionEnd(TRANSITION_DURATION);
|
||||||
|
} else {
|
||||||
|
$(activeElement).removeClass(ClassName.ACTIVE);
|
||||||
|
$(nextElement).addClass(ClassName.ACTIVE);
|
||||||
|
|
||||||
|
this._isSliding = false;
|
||||||
|
$(this._element).trigger(slidEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
if (isCycling) {
|
||||||
|
this.cycle();
|
||||||
}], [{
|
|
||||||
key: '_jQueryInterface',
|
|
||||||
value: function _jQueryInterface(config) {
|
|
||||||
return this.each(function () {
|
|
||||||
var data = $(this).data(DATA_KEY);
|
|
||||||
var _config = $.extend({}, Default, $(this).data());
|
|
||||||
|
|
||||||
if (typeof config === 'object') {
|
|
||||||
$.extend(_config, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
var action = typeof config === 'string' ? config : _config.slide;
|
|
||||||
|
|
||||||
if (!data) {
|
|
||||||
data = new Carousel(this, _config);
|
|
||||||
$(this).data(DATA_KEY, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof config === 'number') {
|
|
||||||
data.to(config);
|
|
||||||
} else if (typeof action === 'string') {
|
|
||||||
if (data[action] === undefined) {
|
|
||||||
throw new Error('No method named "' + action + '"');
|
|
||||||
}
|
|
||||||
data[action]();
|
|
||||||
} else if (_config.interval) {
|
|
||||||
data.pause();
|
|
||||||
data.cycle();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}, {
|
};
|
||||||
key: '_dataApiClickHandler',
|
|
||||||
value: function _dataApiClickHandler(event) {
|
|
||||||
var selector = Util.getSelectorFromElement(this);
|
|
||||||
|
|
||||||
if (!selector) {
|
// static
|
||||||
return;
|
|
||||||
|
Carousel._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var data = $(this).data(DATA_KEY);
|
||||||
|
var _config = $.extend({}, Default, $(this).data());
|
||||||
|
|
||||||
|
if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object') {
|
||||||
|
$.extend(_config, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
var target = $(selector)[0];
|
var action = typeof config === 'string' ? config : _config.slide;
|
||||||
|
|
||||||
if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {
|
if (!data) {
|
||||||
return;
|
data = new Carousel(this, _config);
|
||||||
|
$(this).data(DATA_KEY, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
var config = $.extend({}, $(target).data(), $(this).data());
|
if (typeof config === 'number') {
|
||||||
var slideIndex = this.getAttribute('data-slide-to');
|
data.to(config);
|
||||||
|
} else if (typeof action === 'string') {
|
||||||
if (slideIndex) {
|
if (data[action] === undefined) {
|
||||||
config.interval = false;
|
throw new Error('No method named "' + action + '"');
|
||||||
|
}
|
||||||
|
data[action]();
|
||||||
|
} else if (_config.interval) {
|
||||||
|
data.pause();
|
||||||
|
data.cycle();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
Carousel._jQueryInterface.call($(target), config);
|
Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
|
||||||
|
var selector = Util.getSelectorFromElement(this);
|
||||||
|
|
||||||
if (slideIndex) {
|
if (!selector) {
|
||||||
$(target).data(DATA_KEY).to(slideIndex);
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
|
var target = $(selector)[0];
|
||||||
|
|
||||||
|
if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var config = $.extend({}, $(target).data(), $(this).data());
|
||||||
|
var slideIndex = this.getAttribute('data-slide-to');
|
||||||
|
|
||||||
|
if (slideIndex) {
|
||||||
|
config.interval = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel._jQueryInterface.call($(target), config);
|
||||||
|
|
||||||
|
if (slideIndex) {
|
||||||
|
$(target).data(DATA_KEY).to(slideIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(Carousel, null, [{
|
||||||
key: 'VERSION',
|
key: 'VERSION',
|
||||||
get: function get() {
|
get: function get() {
|
||||||
return VERSION;
|
return VERSION;
|
||||||
|
@ -453,7 +427,13 @@ var Carousel = (function ($) {
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return Carousel;
|
return Carousel;
|
||||||
})();
|
}();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
|
$(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
|
||||||
|
|
||||||
|
@ -478,5 +458,5 @@ var Carousel = (function ($) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return Carousel;
|
return Carousel;
|
||||||
})(jQuery);
|
}(jQuery);
|
||||||
//# sourceMappingURL=carousel.js.map
|
//# sourceMappingURL=carousel.js.map
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,8 +1,8 @@
|
||||||
'use strict';
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||||
|
|
||||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
|
@ -11,7 +11,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Collapse = (function ($) {
|
var Collapse = function ($) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
@ -68,7 +68,7 @@ var Collapse = (function ($) {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Collapse = (function () {
|
var Collapse = function () {
|
||||||
function Collapse(element, config) {
|
function Collapse(element, config) {
|
||||||
_classCallCheck(this, Collapse);
|
_classCallCheck(this, Collapse);
|
||||||
|
|
||||||
|
@ -88,240 +88,220 @@ var Collapse = (function ($) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Data Api implementation
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
|
|
||||||
_createClass(Collapse, [{
|
// public
|
||||||
key: 'toggle',
|
|
||||||
|
|
||||||
// public
|
Collapse.prototype.toggle = function toggle() {
|
||||||
|
if ($(this._element).hasClass(ClassName.IN)) {
|
||||||
|
this.hide();
|
||||||
|
} else {
|
||||||
|
this.show();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
value: function toggle() {
|
Collapse.prototype.show = function show() {
|
||||||
if ($(this._element).hasClass(ClassName.IN)) {
|
var _this = this;
|
||||||
this.hide();
|
|
||||||
} else {
|
if (this._isTransitioning || $(this._element).hasClass(ClassName.IN)) {
|
||||||
this.show();
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var actives = void 0;
|
||||||
|
var activesData = void 0;
|
||||||
|
|
||||||
|
if (this._parent) {
|
||||||
|
actives = $.makeArray($(Selector.ACTIVES));
|
||||||
|
if (!actives.length) {
|
||||||
|
actives = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
key: 'show',
|
|
||||||
value: function show() {
|
|
||||||
var _this = this;
|
|
||||||
|
|
||||||
if (this._isTransitioning || $(this._element).hasClass(ClassName.IN)) {
|
if (actives) {
|
||||||
|
activesData = $(actives).data(DATA_KEY);
|
||||||
|
if (activesData && activesData._isTransitioning) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var actives = undefined;
|
var startEvent = $.Event(Event.SHOW);
|
||||||
var activesData = undefined;
|
$(this._element).trigger(startEvent);
|
||||||
|
if (startEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this._parent) {
|
if (actives) {
|
||||||
actives = $.makeArray($(Selector.ACTIVES));
|
Collapse._jQueryInterface.call($(actives), 'hide');
|
||||||
if (!actives.length) {
|
if (!activesData) {
|
||||||
actives = null;
|
$(actives).data(DATA_KEY, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var dimension = this._getDimension();
|
||||||
|
|
||||||
|
$(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
|
||||||
|
|
||||||
|
this._element.style[dimension] = 0;
|
||||||
|
this._element.setAttribute('aria-expanded', true);
|
||||||
|
|
||||||
|
if (this._triggerArray.length) {
|
||||||
|
$(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setTransitioning(true);
|
||||||
|
|
||||||
|
var complete = function complete() {
|
||||||
|
$(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.IN);
|
||||||
|
|
||||||
|
_this._element.style[dimension] = '';
|
||||||
|
|
||||||
|
_this.setTransitioning(false);
|
||||||
|
|
||||||
|
$(_this._element).trigger(Event.SHOWN);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!Util.supportsTransitionEnd()) {
|
||||||
|
complete();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
||||||
|
var scrollSize = 'scroll' + capitalizedDimension;
|
||||||
|
|
||||||
|
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
||||||
|
|
||||||
|
this._element.style[dimension] = this._element[scrollSize] + 'px';
|
||||||
|
};
|
||||||
|
|
||||||
|
Collapse.prototype.hide = function hide() {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
if (this._isTransitioning || !$(this._element).hasClass(ClassName.IN)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var startEvent = $.Event(Event.HIDE);
|
||||||
|
$(this._element).trigger(startEvent);
|
||||||
|
if (startEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var dimension = this._getDimension();
|
||||||
|
var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight';
|
||||||
|
|
||||||
|
this._element.style[dimension] = this._element[offsetDimension] + 'px';
|
||||||
|
|
||||||
|
Util.reflow(this._element);
|
||||||
|
|
||||||
|
$(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.IN);
|
||||||
|
|
||||||
|
this._element.setAttribute('aria-expanded', false);
|
||||||
|
|
||||||
|
if (this._triggerArray.length) {
|
||||||
|
$(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setTransitioning(true);
|
||||||
|
|
||||||
|
var complete = function complete() {
|
||||||
|
_this2.setTransitioning(false);
|
||||||
|
$(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
|
||||||
|
};
|
||||||
|
|
||||||
|
this._element.style[dimension] = 0;
|
||||||
|
|
||||||
|
if (!Util.supportsTransitionEnd()) {
|
||||||
|
complete();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
||||||
|
};
|
||||||
|
|
||||||
|
Collapse.prototype.setTransitioning = function setTransitioning(isTransitioning) {
|
||||||
|
this._isTransitioning = isTransitioning;
|
||||||
|
};
|
||||||
|
|
||||||
|
Collapse.prototype.dispose = function dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY);
|
||||||
|
|
||||||
|
this._config = null;
|
||||||
|
this._parent = null;
|
||||||
|
this._element = null;
|
||||||
|
this._triggerArray = null;
|
||||||
|
this._isTransitioning = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
// private
|
||||||
|
|
||||||
|
Collapse.prototype._getConfig = function _getConfig(config) {
|
||||||
|
config = $.extend({}, Default, config);
|
||||||
|
config.toggle = Boolean(config.toggle); // coerce string values
|
||||||
|
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
Collapse.prototype._getDimension = function _getDimension() {
|
||||||
|
var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
|
||||||
|
return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
|
||||||
|
};
|
||||||
|
|
||||||
|
Collapse.prototype._getParent = function _getParent() {
|
||||||
|
var _this3 = this;
|
||||||
|
|
||||||
|
var parent = $(this._config.parent)[0];
|
||||||
|
var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]';
|
||||||
|
|
||||||
|
$(parent).find(selector).each(function (i, element) {
|
||||||
|
_this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
|
||||||
|
});
|
||||||
|
|
||||||
|
return parent;
|
||||||
|
};
|
||||||
|
|
||||||
|
Collapse.prototype._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
|
||||||
|
if (element) {
|
||||||
|
var isOpen = $(element).hasClass(ClassName.IN);
|
||||||
|
element.setAttribute('aria-expanded', isOpen);
|
||||||
|
|
||||||
|
if (triggerArray.length) {
|
||||||
|
$(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// static
|
||||||
|
|
||||||
|
Collapse._getTargetFromElement = function _getTargetFromElement(element) {
|
||||||
|
var selector = Util.getSelectorFromElement(element);
|
||||||
|
return selector ? $(selector)[0] : null;
|
||||||
|
};
|
||||||
|
|
||||||
|
Collapse._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this);
|
||||||
|
var data = $this.data(DATA_KEY);
|
||||||
|
var _config = $.extend({}, Default, $this.data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
|
||||||
|
|
||||||
|
if (!data && _config.toggle && /show|hide/.test(config)) {
|
||||||
|
_config.toggle = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Collapse(this, _config);
|
||||||
|
$this.data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (data[config] === undefined) {
|
||||||
|
throw new Error('No method named "' + config + '"');
|
||||||
}
|
}
|
||||||
|
data[config]();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
if (actives) {
|
_createClass(Collapse, null, [{
|
||||||
activesData = $(actives).data(DATA_KEY);
|
|
||||||
if (activesData && activesData._isTransitioning) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var startEvent = $.Event(Event.SHOW);
|
|
||||||
$(this._element).trigger(startEvent);
|
|
||||||
if (startEvent.isDefaultPrevented()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (actives) {
|
|
||||||
Collapse._jQueryInterface.call($(actives), 'hide');
|
|
||||||
if (!activesData) {
|
|
||||||
$(actives).data(DATA_KEY, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var dimension = this._getDimension();
|
|
||||||
|
|
||||||
$(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
|
|
||||||
|
|
||||||
this._element.style[dimension] = 0;
|
|
||||||
this._element.setAttribute('aria-expanded', true);
|
|
||||||
|
|
||||||
if (this._triggerArray.length) {
|
|
||||||
$(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setTransitioning(true);
|
|
||||||
|
|
||||||
var complete = function complete() {
|
|
||||||
$(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.IN);
|
|
||||||
|
|
||||||
_this._element.style[dimension] = '';
|
|
||||||
|
|
||||||
_this.setTransitioning(false);
|
|
||||||
|
|
||||||
$(_this._element).trigger(Event.SHOWN);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!Util.supportsTransitionEnd()) {
|
|
||||||
complete();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
|
||||||
var scrollSize = 'scroll' + capitalizedDimension;
|
|
||||||
|
|
||||||
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
|
||||||
|
|
||||||
this._element.style[dimension] = this._element[scrollSize] + 'px';
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'hide',
|
|
||||||
value: function hide() {
|
|
||||||
var _this2 = this;
|
|
||||||
|
|
||||||
if (this._isTransitioning || !$(this._element).hasClass(ClassName.IN)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var startEvent = $.Event(Event.HIDE);
|
|
||||||
$(this._element).trigger(startEvent);
|
|
||||||
if (startEvent.isDefaultPrevented()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var dimension = this._getDimension();
|
|
||||||
var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight';
|
|
||||||
|
|
||||||
this._element.style[dimension] = this._element[offsetDimension] + 'px';
|
|
||||||
|
|
||||||
Util.reflow(this._element);
|
|
||||||
|
|
||||||
$(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.IN);
|
|
||||||
|
|
||||||
this._element.setAttribute('aria-expanded', false);
|
|
||||||
|
|
||||||
if (this._triggerArray.length) {
|
|
||||||
$(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setTransitioning(true);
|
|
||||||
|
|
||||||
var complete = function complete() {
|
|
||||||
_this2.setTransitioning(false);
|
|
||||||
$(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
|
|
||||||
};
|
|
||||||
|
|
||||||
this._element.style[dimension] = 0;
|
|
||||||
|
|
||||||
if (!Util.supportsTransitionEnd()) {
|
|
||||||
complete();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'setTransitioning',
|
|
||||||
value: function setTransitioning(isTransitioning) {
|
|
||||||
this._isTransitioning = isTransitioning;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'dispose',
|
|
||||||
value: function dispose() {
|
|
||||||
$.removeData(this._element, DATA_KEY);
|
|
||||||
|
|
||||||
this._config = null;
|
|
||||||
this._parent = null;
|
|
||||||
this._element = null;
|
|
||||||
this._triggerArray = null;
|
|
||||||
this._isTransitioning = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// private
|
|
||||||
|
|
||||||
}, {
|
|
||||||
key: '_getConfig',
|
|
||||||
value: function _getConfig(config) {
|
|
||||||
config = $.extend({}, Default, config);
|
|
||||||
config.toggle = Boolean(config.toggle); // coerce string values
|
|
||||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
|
||||||
return config;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_getDimension',
|
|
||||||
value: function _getDimension() {
|
|
||||||
var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
|
|
||||||
return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_getParent',
|
|
||||||
value: function _getParent() {
|
|
||||||
var _this3 = this;
|
|
||||||
|
|
||||||
var parent = $(this._config.parent)[0];
|
|
||||||
var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]';
|
|
||||||
|
|
||||||
$(parent).find(selector).each(function (i, element) {
|
|
||||||
_this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
|
|
||||||
});
|
|
||||||
|
|
||||||
return parent;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_addAriaAndCollapsedClass',
|
|
||||||
value: function _addAriaAndCollapsedClass(element, triggerArray) {
|
|
||||||
if (element) {
|
|
||||||
var isOpen = $(element).hasClass(ClassName.IN);
|
|
||||||
element.setAttribute('aria-expanded', isOpen);
|
|
||||||
|
|
||||||
if (triggerArray.length) {
|
|
||||||
$(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
|
||||||
|
|
||||||
}], [{
|
|
||||||
key: '_getTargetFromElement',
|
|
||||||
value: function _getTargetFromElement(element) {
|
|
||||||
var selector = Util.getSelectorFromElement(element);
|
|
||||||
return selector ? $(selector)[0] : null;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_jQueryInterface',
|
|
||||||
value: function _jQueryInterface(config) {
|
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this);
|
|
||||||
var data = $this.data(DATA_KEY);
|
|
||||||
var _config = $.extend({}, Default, $this.data(), typeof config === 'object' && config);
|
|
||||||
|
|
||||||
if (!data && _config.toggle && /show|hide/.test(config)) {
|
|
||||||
_config.toggle = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!data) {
|
|
||||||
data = new Collapse(this, _config);
|
|
||||||
$this.data(DATA_KEY, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
|
||||||
if (data[config] === undefined) {
|
|
||||||
throw new Error('No method named "' + config + '"');
|
|
||||||
}
|
|
||||||
data[config]();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'VERSION',
|
key: 'VERSION',
|
||||||
get: function get() {
|
get: function get() {
|
||||||
return VERSION;
|
return VERSION;
|
||||||
|
@ -334,7 +314,13 @@ var Collapse = (function ($) {
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return Collapse;
|
return Collapse;
|
||||||
})();
|
}();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -360,5 +346,5 @@ var Collapse = (function ($) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return Collapse;
|
return Collapse;
|
||||||
})(jQuery);
|
}(jQuery);
|
||||||
//# sourceMappingURL=collapse.js.map
|
//# sourceMappingURL=collapse.js.map
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,8 +1,6 @@
|
||||||
'use strict';
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||||
|
|
||||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
|
@ -11,7 +9,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Dropdown = (function ($) {
|
var Dropdown = function ($) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
@ -62,7 +60,7 @@ var Dropdown = (function ($) {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Dropdown = (function () {
|
var Dropdown = function () {
|
||||||
function Dropdown(element) {
|
function Dropdown(element) {
|
||||||
_classCallCheck(this, Dropdown);
|
_classCallCheck(this, Dropdown);
|
||||||
|
|
||||||
|
@ -71,201 +69,185 @@ var Dropdown = (function ($) {
|
||||||
this._addEventListeners();
|
this._addEventListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Data Api implementation
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
|
|
||||||
_createClass(Dropdown, [{
|
// public
|
||||||
key: 'toggle',
|
|
||||||
|
|
||||||
// public
|
|
||||||
|
|
||||||
value: function toggle() {
|
|
||||||
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var parent = Dropdown._getParentFromElement(this);
|
|
||||||
var isActive = $(parent).hasClass(ClassName.OPEN);
|
|
||||||
|
|
||||||
Dropdown._clearMenus();
|
|
||||||
|
|
||||||
if (isActive) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) {
|
|
||||||
|
|
||||||
// if mobile we use a backdrop because click events don't delegate
|
|
||||||
var dropdown = document.createElement('div');
|
|
||||||
dropdown.className = ClassName.BACKDROP;
|
|
||||||
$(dropdown).insertBefore(this);
|
|
||||||
$(dropdown).on('click', Dropdown._clearMenus);
|
|
||||||
}
|
|
||||||
|
|
||||||
var relatedTarget = { relatedTarget: this };
|
|
||||||
var showEvent = $.Event(Event.SHOW, relatedTarget);
|
|
||||||
|
|
||||||
$(parent).trigger(showEvent);
|
|
||||||
|
|
||||||
if (showEvent.isDefaultPrevented()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.focus();
|
|
||||||
this.setAttribute('aria-expanded', 'true');
|
|
||||||
|
|
||||||
$(parent).toggleClass(ClassName.OPEN);
|
|
||||||
$(parent).trigger($.Event(Event.SHOWN, relatedTarget));
|
|
||||||
|
|
||||||
|
Dropdown.prototype.toggle = function toggle() {
|
||||||
|
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
key: 'dispose',
|
var parent = Dropdown._getParentFromElement(this);
|
||||||
value: function dispose() {
|
var isActive = $(parent).hasClass(ClassName.OPEN);
|
||||||
$.removeData(this._element, DATA_KEY);
|
|
||||||
$(this._element).off(EVENT_KEY);
|
Dropdown._clearMenus();
|
||||||
this._element = null;
|
|
||||||
|
if (isActive) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private
|
if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) {
|
||||||
|
|
||||||
}, {
|
// if mobile we use a backdrop because click events don't delegate
|
||||||
key: '_addEventListeners',
|
var dropdown = document.createElement('div');
|
||||||
value: function _addEventListeners() {
|
dropdown.className = ClassName.BACKDROP;
|
||||||
$(this._element).on(Event.CLICK, this.toggle);
|
$(dropdown).insertBefore(this);
|
||||||
|
$(dropdown).on('click', Dropdown._clearMenus);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
var relatedTarget = { relatedTarget: this };
|
||||||
|
var showEvent = $.Event(Event.SHOW, relatedTarget);
|
||||||
|
|
||||||
}], [{
|
$(parent).trigger(showEvent);
|
||||||
key: '_jQueryInterface',
|
|
||||||
value: function _jQueryInterface(config) {
|
|
||||||
return this.each(function () {
|
|
||||||
var data = $(this).data(DATA_KEY);
|
|
||||||
|
|
||||||
if (!data) {
|
if (showEvent.isDefaultPrevented()) {
|
||||||
$(this).data(DATA_KEY, data = new Dropdown(this));
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
|
||||||
if (data[config] === undefined) {
|
|
||||||
throw new Error('No method named "' + config + '"');
|
|
||||||
}
|
|
||||||
data[config].call(this);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
key: '_clearMenus',
|
this.focus();
|
||||||
value: function _clearMenus(event) {
|
this.setAttribute('aria-expanded', 'true');
|
||||||
if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) {
|
|
||||||
return;
|
$(parent).toggleClass(ClassName.OPEN);
|
||||||
|
$(parent).trigger($.Event(Event.SHOWN, relatedTarget));
|
||||||
|
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
Dropdown.prototype.dispose = function dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY);
|
||||||
|
$(this._element).off(EVENT_KEY);
|
||||||
|
this._element = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
// private
|
||||||
|
|
||||||
|
Dropdown.prototype._addEventListeners = function _addEventListeners() {
|
||||||
|
$(this._element).on(Event.CLICK, this.toggle);
|
||||||
|
};
|
||||||
|
|
||||||
|
// static
|
||||||
|
|
||||||
|
Dropdown._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var data = $(this).data(DATA_KEY);
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
$(this).data(DATA_KEY, data = new Dropdown(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
var backdrop = $(Selector.BACKDROP)[0];
|
if (typeof config === 'string') {
|
||||||
if (backdrop) {
|
if (data[config] === undefined) {
|
||||||
backdrop.parentNode.removeChild(backdrop);
|
throw new Error('No method named "' + config + '"');
|
||||||
|
}
|
||||||
|
data[config].call(this);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
var toggles = $.makeArray($(Selector.DATA_TOGGLE));
|
Dropdown._clearMenus = function _clearMenus(event) {
|
||||||
|
if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) {
|
||||||
for (var i = 0; i < toggles.length; i++) {
|
return;
|
||||||
var _parent = Dropdown._getParentFromElement(toggles[i]);
|
|
||||||
var relatedTarget = { relatedTarget: toggles[i] };
|
|
||||||
|
|
||||||
if (!$(_parent).hasClass(ClassName.OPEN)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event && event.type === 'click' && /input|textarea/i.test(event.target.tagName) && $.contains(_parent, event.target)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var hideEvent = $.Event(Event.HIDE, relatedTarget);
|
|
||||||
$(_parent).trigger(hideEvent);
|
|
||||||
if (hideEvent.isDefaultPrevented()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
toggles[i].setAttribute('aria-expanded', 'false');
|
|
||||||
|
|
||||||
$(_parent).removeClass(ClassName.OPEN).trigger($.Event(Event.HIDDEN, relatedTarget));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
key: '_getParentFromElement',
|
|
||||||
value: function _getParentFromElement(element) {
|
|
||||||
var parent = undefined;
|
|
||||||
var selector = Util.getSelectorFromElement(element);
|
|
||||||
|
|
||||||
if (selector) {
|
var backdrop = $(Selector.BACKDROP)[0];
|
||||||
parent = $(selector)[0];
|
if (backdrop) {
|
||||||
}
|
backdrop.parentNode.removeChild(backdrop);
|
||||||
|
|
||||||
return parent || element.parentNode;
|
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
key: '_dataApiKeydownHandler',
|
var toggles = $.makeArray($(Selector.DATA_TOGGLE));
|
||||||
value: function _dataApiKeydownHandler(event) {
|
|
||||||
if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) {
|
for (var i = 0; i < toggles.length; i++) {
|
||||||
return;
|
var parent = Dropdown._getParentFromElement(toggles[i]);
|
||||||
|
var relatedTarget = { relatedTarget: toggles[i] };
|
||||||
|
|
||||||
|
if (!$(parent).hasClass(ClassName.OPEN)) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
event.preventDefault();
|
if (event && event.type === 'click' && /input|textarea/i.test(event.target.tagName) && $.contains(parent, event.target)) {
|
||||||
event.stopPropagation();
|
continue;
|
||||||
|
|
||||||
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var parent = Dropdown._getParentFromElement(this);
|
var hideEvent = $.Event(Event.HIDE, relatedTarget);
|
||||||
var isActive = $(parent).hasClass(ClassName.OPEN);
|
$(parent).trigger(hideEvent);
|
||||||
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
if (!isActive && event.which !== ESCAPE_KEYCODE || isActive && event.which === ESCAPE_KEYCODE) {
|
continue;
|
||||||
|
|
||||||
if (event.which === ESCAPE_KEYCODE) {
|
|
||||||
var toggle = $(parent).find(Selector.DATA_TOGGLE)[0];
|
|
||||||
$(toggle).trigger('focus');
|
|
||||||
}
|
|
||||||
|
|
||||||
$(this).trigger('click');
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var items = $.makeArray($(Selector.VISIBLE_ITEMS));
|
toggles[i].setAttribute('aria-expanded', 'false');
|
||||||
|
|
||||||
items = items.filter(function (item) {
|
$(parent).removeClass(ClassName.OPEN).trigger($.Event(Event.HIDDEN, relatedTarget));
|
||||||
return item.offsetWidth || item.offsetHeight;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!items.length) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var index = items.indexOf(event.target);
|
|
||||||
|
|
||||||
if (event.which === ARROW_UP_KEYCODE && index > 0) {
|
|
||||||
// up
|
|
||||||
index--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
|
|
||||||
// down
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index < 0) {
|
|
||||||
index = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
items[index].focus();
|
|
||||||
}
|
}
|
||||||
}, {
|
};
|
||||||
|
|
||||||
|
Dropdown._getParentFromElement = function _getParentFromElement(element) {
|
||||||
|
var parent = void 0;
|
||||||
|
var selector = Util.getSelectorFromElement(element);
|
||||||
|
|
||||||
|
if (selector) {
|
||||||
|
parent = $(selector)[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent || element.parentNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
|
||||||
|
if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var parent = Dropdown._getParentFromElement(this);
|
||||||
|
var isActive = $(parent).hasClass(ClassName.OPEN);
|
||||||
|
|
||||||
|
if (!isActive && event.which !== ESCAPE_KEYCODE || isActive && event.which === ESCAPE_KEYCODE) {
|
||||||
|
|
||||||
|
if (event.which === ESCAPE_KEYCODE) {
|
||||||
|
var toggle = $(parent).find(Selector.DATA_TOGGLE)[0];
|
||||||
|
$(toggle).trigger('focus');
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this).trigger('click');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var items = $.makeArray($(Selector.VISIBLE_ITEMS));
|
||||||
|
|
||||||
|
items = items.filter(function (item) {
|
||||||
|
return item.offsetWidth || item.offsetHeight;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!items.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var index = items.indexOf(event.target);
|
||||||
|
|
||||||
|
if (event.which === ARROW_UP_KEYCODE && index > 0) {
|
||||||
|
// up
|
||||||
|
index--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
|
||||||
|
// down
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index < 0) {
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
items[index].focus();
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(Dropdown, null, [{
|
||||||
key: 'VERSION',
|
key: 'VERSION',
|
||||||
get: function get() {
|
get: function get() {
|
||||||
return VERSION;
|
return VERSION;
|
||||||
|
@ -273,7 +255,13 @@ var Dropdown = (function ($) {
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return Dropdown;
|
return Dropdown;
|
||||||
})();
|
}();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
$(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
|
$(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
@ -293,5 +281,5 @@ var Dropdown = (function ($) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return Dropdown;
|
return Dropdown;
|
||||||
})(jQuery);
|
}(jQuery);
|
||||||
//# sourceMappingURL=dropdown.js.map
|
//# sourceMappingURL=dropdown.js.map
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,8 +1,8 @@
|
||||||
'use strict';
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||||
|
|
||||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
|
@ -11,7 +11,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Modal = (function ($) {
|
var Modal = function ($) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
@ -78,7 +78,7 @@ var Modal = (function ($) {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Modal = (function () {
|
var Modal = function () {
|
||||||
function Modal(element, config) {
|
function Modal(element, config) {
|
||||||
_classCallCheck(this, Modal);
|
_classCallCheck(this, Modal);
|
||||||
|
|
||||||
|
@ -93,382 +93,352 @@ var Modal = (function ($) {
|
||||||
this._scrollbarWidth = 0;
|
this._scrollbarWidth = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Data Api implementation
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
|
|
||||||
_createClass(Modal, [{
|
// public
|
||||||
key: 'toggle',
|
|
||||||
|
|
||||||
// public
|
Modal.prototype.toggle = function toggle(relatedTarget) {
|
||||||
|
return this._isShown ? this.hide() : this.show(relatedTarget);
|
||||||
|
};
|
||||||
|
|
||||||
value: function toggle(relatedTarget) {
|
Modal.prototype.show = function show(relatedTarget) {
|
||||||
return this._isShown ? this.hide() : this.show(relatedTarget);
|
var _this = this;
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'show',
|
|
||||||
value: function show(relatedTarget) {
|
|
||||||
var _this = this;
|
|
||||||
|
|
||||||
var showEvent = $.Event(Event.SHOW, {
|
var showEvent = $.Event(Event.SHOW, {
|
||||||
relatedTarget: relatedTarget
|
relatedTarget: relatedTarget
|
||||||
});
|
});
|
||||||
|
|
||||||
$(this._element).trigger(showEvent);
|
$(this._element).trigger(showEvent);
|
||||||
|
|
||||||
if (this._isShown || showEvent.isDefaultPrevented()) {
|
if (this._isShown || showEvent.isDefaultPrevented()) {
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
this._isShown = true;
|
|
||||||
|
|
||||||
this._checkScrollbar();
|
|
||||||
this._setScrollbar();
|
|
||||||
|
|
||||||
$(document.body).addClass(ClassName.OPEN);
|
|
||||||
|
|
||||||
this._setEscapeEvent();
|
|
||||||
this._setResizeEvent();
|
|
||||||
|
|
||||||
$(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this));
|
|
||||||
|
|
||||||
$(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
|
|
||||||
$(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
|
|
||||||
if ($(event.target).is(_this._element)) {
|
|
||||||
_this._ignoreBackdropClick = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this._showBackdrop($.proxy(this._showElement, this, relatedTarget));
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'hide',
|
|
||||||
value: function hide(event) {
|
|
||||||
if (event) {
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
var hideEvent = $.Event(Event.HIDE);
|
|
||||||
|
|
||||||
$(this._element).trigger(hideEvent);
|
|
||||||
|
|
||||||
if (!this._isShown || hideEvent.isDefaultPrevented()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this._isShown = false;
|
|
||||||
|
|
||||||
this._setEscapeEvent();
|
|
||||||
this._setResizeEvent();
|
|
||||||
|
|
||||||
$(document).off(Event.FOCUSIN);
|
|
||||||
|
|
||||||
$(this._element).removeClass(ClassName.IN);
|
|
||||||
|
|
||||||
$(this._element).off(Event.CLICK_DISMISS);
|
|
||||||
$(this._dialog).off(Event.MOUSEDOWN_DISMISS);
|
|
||||||
|
|
||||||
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
|
|
||||||
|
|
||||||
$(this._element).one(Util.TRANSITION_END, $.proxy(this._hideModal, this)).emulateTransitionEnd(TRANSITION_DURATION);
|
|
||||||
} else {
|
|
||||||
this._hideModal();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'dispose',
|
|
||||||
value: function dispose() {
|
|
||||||
$.removeData(this._element, DATA_KEY);
|
|
||||||
|
|
||||||
$(window).off(EVENT_KEY);
|
|
||||||
$(document).off(EVENT_KEY);
|
|
||||||
$(this._element).off(EVENT_KEY);
|
|
||||||
$(this._backdrop).off(EVENT_KEY);
|
|
||||||
|
|
||||||
this._config = null;
|
|
||||||
this._element = null;
|
|
||||||
this._dialog = null;
|
|
||||||
this._backdrop = null;
|
|
||||||
this._isShown = null;
|
|
||||||
this._isBodyOverflowing = null;
|
|
||||||
this._ignoreBackdropClick = null;
|
|
||||||
this._originalBodyPadding = null;
|
|
||||||
this._scrollbarWidth = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// private
|
this._isShown = true;
|
||||||
|
|
||||||
}, {
|
this._checkScrollbar();
|
||||||
key: '_getConfig',
|
this._setScrollbar();
|
||||||
value: function _getConfig(config) {
|
|
||||||
config = $.extend({}, Default, config);
|
|
||||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
|
||||||
return config;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_showElement',
|
|
||||||
value: function _showElement(relatedTarget) {
|
|
||||||
var _this2 = this;
|
|
||||||
|
|
||||||
var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
|
$(document.body).addClass(ClassName.OPEN);
|
||||||
|
|
||||||
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
this._setEscapeEvent();
|
||||||
// don't move modals dom position
|
this._setResizeEvent();
|
||||||
document.body.appendChild(this._element);
|
|
||||||
}
|
|
||||||
|
|
||||||
this._element.style.display = 'block';
|
$(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this));
|
||||||
this._element.removeAttribute('aria-hidden');
|
|
||||||
this._element.scrollTop = 0;
|
|
||||||
|
|
||||||
if (transition) {
|
$(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
|
||||||
Util.reflow(this._element);
|
$(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
|
||||||
}
|
if ($(event.target).is(_this._element)) {
|
||||||
|
_this._ignoreBackdropClick = true;
|
||||||
$(this._element).addClass(ClassName.IN);
|
}
|
||||||
|
});
|
||||||
if (this._config.focus) {
|
});
|
||||||
this._enforceFocus();
|
|
||||||
}
|
this._showBackdrop($.proxy(this._showElement, this, relatedTarget));
|
||||||
|
};
|
||||||
var shownEvent = $.Event(Event.SHOWN, {
|
|
||||||
relatedTarget: relatedTarget
|
Modal.prototype.hide = function hide(event) {
|
||||||
});
|
if (event) {
|
||||||
|
event.preventDefault();
|
||||||
var transitionComplete = function transitionComplete() {
|
}
|
||||||
if (_this2._config.focus) {
|
|
||||||
_this2._element.focus();
|
var hideEvent = $.Event(Event.HIDE);
|
||||||
|
|
||||||
|
$(this._element).trigger(hideEvent);
|
||||||
|
|
||||||
|
if (!this._isShown || hideEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._isShown = false;
|
||||||
|
|
||||||
|
this._setEscapeEvent();
|
||||||
|
this._setResizeEvent();
|
||||||
|
|
||||||
|
$(document).off(Event.FOCUSIN);
|
||||||
|
|
||||||
|
$(this._element).removeClass(ClassName.IN);
|
||||||
|
|
||||||
|
$(this._element).off(Event.CLICK_DISMISS);
|
||||||
|
$(this._dialog).off(Event.MOUSEDOWN_DISMISS);
|
||||||
|
|
||||||
|
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
|
||||||
|
|
||||||
|
$(this._element).one(Util.TRANSITION_END, $.proxy(this._hideModal, this)).emulateTransitionEnd(TRANSITION_DURATION);
|
||||||
|
} else {
|
||||||
|
this._hideModal();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Modal.prototype.dispose = function dispose() {
|
||||||
|
$.removeData(this._element, DATA_KEY);
|
||||||
|
|
||||||
|
$(window).off(EVENT_KEY);
|
||||||
|
$(document).off(EVENT_KEY);
|
||||||
|
$(this._element).off(EVENT_KEY);
|
||||||
|
$(this._backdrop).off(EVENT_KEY);
|
||||||
|
|
||||||
|
this._config = null;
|
||||||
|
this._element = null;
|
||||||
|
this._dialog = null;
|
||||||
|
this._backdrop = null;
|
||||||
|
this._isShown = null;
|
||||||
|
this._isBodyOverflowing = null;
|
||||||
|
this._ignoreBackdropClick = null;
|
||||||
|
this._originalBodyPadding = null;
|
||||||
|
this._scrollbarWidth = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
// private
|
||||||
|
|
||||||
|
Modal.prototype._getConfig = function _getConfig(config) {
|
||||||
|
config = $.extend({}, Default, config);
|
||||||
|
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
Modal.prototype._showElement = function _showElement(relatedTarget) {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
|
||||||
|
|
||||||
|
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
||||||
|
// don't move modals dom position
|
||||||
|
document.body.appendChild(this._element);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._element.style.display = 'block';
|
||||||
|
this._element.removeAttribute('aria-hidden');
|
||||||
|
this._element.scrollTop = 0;
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
Util.reflow(this._element);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._element).addClass(ClassName.IN);
|
||||||
|
|
||||||
|
if (this._config.focus) {
|
||||||
|
this._enforceFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
var shownEvent = $.Event(Event.SHOWN, {
|
||||||
|
relatedTarget: relatedTarget
|
||||||
|
});
|
||||||
|
|
||||||
|
var transitionComplete = function transitionComplete() {
|
||||||
|
if (_this2._config.focus) {
|
||||||
|
_this2._element.focus();
|
||||||
|
}
|
||||||
|
$(_this2._element).trigger(shownEvent);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
$(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
|
||||||
|
} else {
|
||||||
|
transitionComplete();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Modal.prototype._enforceFocus = function _enforceFocus() {
|
||||||
|
var _this3 = this;
|
||||||
|
|
||||||
|
$(document).off(Event.FOCUSIN) // guard against infinite focus loop
|
||||||
|
.on(Event.FOCUSIN, function (event) {
|
||||||
|
if (document !== event.target && _this3._element !== event.target && !$(_this3._element).has(event.target).length) {
|
||||||
|
_this3._element.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Modal.prototype._setEscapeEvent = function _setEscapeEvent() {
|
||||||
|
var _this4 = this;
|
||||||
|
|
||||||
|
if (this._isShown && this._config.keyboard) {
|
||||||
|
$(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
|
||||||
|
if (event.which === ESCAPE_KEYCODE) {
|
||||||
|
_this4.hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (!this._isShown) {
|
||||||
|
$(this._element).off(Event.KEYDOWN_DISMISS);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Modal.prototype._setResizeEvent = function _setResizeEvent() {
|
||||||
|
if (this._isShown) {
|
||||||
|
$(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this));
|
||||||
|
} else {
|
||||||
|
$(window).off(Event.RESIZE);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Modal.prototype._hideModal = function _hideModal() {
|
||||||
|
var _this5 = this;
|
||||||
|
|
||||||
|
this._element.style.display = 'none';
|
||||||
|
this._element.setAttribute('aria-hidden', 'true');
|
||||||
|
this._showBackdrop(function () {
|
||||||
|
$(document.body).removeClass(ClassName.OPEN);
|
||||||
|
_this5._resetAdjustments();
|
||||||
|
_this5._resetScrollbar();
|
||||||
|
$(_this5._element).trigger(Event.HIDDEN);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Modal.prototype._removeBackdrop = function _removeBackdrop() {
|
||||||
|
if (this._backdrop) {
|
||||||
|
$(this._backdrop).remove();
|
||||||
|
this._backdrop = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Modal.prototype._showBackdrop = function _showBackdrop(callback) {
|
||||||
|
var _this6 = this;
|
||||||
|
|
||||||
|
var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
|
||||||
|
|
||||||
|
if (this._isShown && this._config.backdrop) {
|
||||||
|
var doAnimate = Util.supportsTransitionEnd() && animate;
|
||||||
|
|
||||||
|
this._backdrop = document.createElement('div');
|
||||||
|
this._backdrop.className = ClassName.BACKDROP;
|
||||||
|
|
||||||
|
if (animate) {
|
||||||
|
$(this._backdrop).addClass(animate);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._backdrop).appendTo(document.body);
|
||||||
|
|
||||||
|
$(this._element).on(Event.CLICK_DISMISS, function (event) {
|
||||||
|
if (_this6._ignoreBackdropClick) {
|
||||||
|
_this6._ignoreBackdropClick = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event.target !== event.currentTarget) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (_this6._config.backdrop === 'static') {
|
||||||
|
_this6._element.focus();
|
||||||
|
} else {
|
||||||
|
_this6.hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (doAnimate) {
|
||||||
|
Util.reflow(this._backdrop);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._backdrop).addClass(ClassName.IN);
|
||||||
|
|
||||||
|
if (!callback) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!doAnimate) {
|
||||||
|
callback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
|
||||||
|
} else if (!this._isShown && this._backdrop) {
|
||||||
|
$(this._backdrop).removeClass(ClassName.IN);
|
||||||
|
|
||||||
|
var callbackRemove = function callbackRemove() {
|
||||||
|
_this6._removeBackdrop();
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
}
|
}
|
||||||
$(_this2._element).trigger(shownEvent);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (transition) {
|
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
|
||||||
$(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
|
$(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
|
||||||
} else {
|
} else {
|
||||||
transitionComplete();
|
callbackRemove();
|
||||||
}
|
}
|
||||||
|
} else if (callback) {
|
||||||
|
callback();
|
||||||
}
|
}
|
||||||
}, {
|
};
|
||||||
key: '_enforceFocus',
|
|
||||||
value: function _enforceFocus() {
|
|
||||||
var _this3 = this;
|
|
||||||
|
|
||||||
$(document).off(Event.FOCUSIN) // guard against infinite focus loop
|
// ----------------------------------------------------------------------
|
||||||
.on(Event.FOCUSIN, function (event) {
|
// the following methods are used to handle overflowing modals
|
||||||
if (document !== event.target && _this3._element !== event.target && !$(_this3._element).has(event.target).length) {
|
// todo (fat): these should probably be refactored out of modal.js
|
||||||
_this3._element.focus();
|
// ----------------------------------------------------------------------
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_setEscapeEvent',
|
|
||||||
value: function _setEscapeEvent() {
|
|
||||||
var _this4 = this;
|
|
||||||
|
|
||||||
if (this._isShown && this._config.keyboard) {
|
Modal.prototype._handleUpdate = function _handleUpdate() {
|
||||||
$(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
|
this._adjustDialog();
|
||||||
if (event.which === ESCAPE_KEYCODE) {
|
};
|
||||||
_this4.hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (!this._isShown) {
|
|
||||||
$(this._element).off(Event.KEYDOWN_DISMISS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_setResizeEvent',
|
|
||||||
value: function _setResizeEvent() {
|
|
||||||
if (this._isShown) {
|
|
||||||
$(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this));
|
|
||||||
} else {
|
|
||||||
$(window).off(Event.RESIZE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_hideModal',
|
|
||||||
value: function _hideModal() {
|
|
||||||
var _this5 = this;
|
|
||||||
|
|
||||||
this._element.style.display = 'none';
|
Modal.prototype._adjustDialog = function _adjustDialog() {
|
||||||
this._element.setAttribute('aria-hidden', 'true');
|
var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
|
||||||
this._showBackdrop(function () {
|
|
||||||
$(document.body).removeClass(ClassName.OPEN);
|
|
||||||
_this5._resetAdjustments();
|
|
||||||
_this5._resetScrollbar();
|
|
||||||
$(_this5._element).trigger(Event.HIDDEN);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_removeBackdrop',
|
|
||||||
value: function _removeBackdrop() {
|
|
||||||
if (this._backdrop) {
|
|
||||||
$(this._backdrop).remove();
|
|
||||||
this._backdrop = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_showBackdrop',
|
|
||||||
value: function _showBackdrop(callback) {
|
|
||||||
var _this6 = this;
|
|
||||||
|
|
||||||
var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
|
if (!this._isBodyOverflowing && isModalOverflowing) {
|
||||||
|
this._element.style.paddingLeft = this._scrollbarWidth + 'px';
|
||||||
if (this._isShown && this._config.backdrop) {
|
|
||||||
var doAnimate = Util.supportsTransitionEnd() && animate;
|
|
||||||
|
|
||||||
this._backdrop = document.createElement('div');
|
|
||||||
this._backdrop.className = ClassName.BACKDROP;
|
|
||||||
|
|
||||||
if (animate) {
|
|
||||||
$(this._backdrop).addClass(animate);
|
|
||||||
}
|
|
||||||
|
|
||||||
$(this._backdrop).appendTo(document.body);
|
|
||||||
|
|
||||||
$(this._element).on(Event.CLICK_DISMISS, function (event) {
|
|
||||||
if (_this6._ignoreBackdropClick) {
|
|
||||||
_this6._ignoreBackdropClick = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (event.target !== event.currentTarget) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (_this6._config.backdrop === 'static') {
|
|
||||||
_this6._element.focus();
|
|
||||||
} else {
|
|
||||||
_this6.hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (doAnimate) {
|
|
||||||
Util.reflow(this._backdrop);
|
|
||||||
}
|
|
||||||
|
|
||||||
$(this._backdrop).addClass(ClassName.IN);
|
|
||||||
|
|
||||||
if (!callback) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!doAnimate) {
|
|
||||||
callback();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
|
|
||||||
} else if (!this._isShown && this._backdrop) {
|
|
||||||
$(this._backdrop).removeClass(ClassName.IN);
|
|
||||||
|
|
||||||
var callbackRemove = function callbackRemove() {
|
|
||||||
_this6._removeBackdrop();
|
|
||||||
if (callback) {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
|
|
||||||
$(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
|
|
||||||
} else {
|
|
||||||
callbackRemove();
|
|
||||||
}
|
|
||||||
} else if (callback) {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
if (this._isBodyOverflowing && !isModalOverflowing) {
|
||||||
// the following methods are used to handle overflowing modals
|
this._element.style.paddingRight = this._scrollbarWidth + 'px';
|
||||||
// todo (fat): these should probably be refactored out of modal.js
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
}, {
|
|
||||||
key: '_handleUpdate',
|
|
||||||
value: function _handleUpdate() {
|
|
||||||
this._adjustDialog();
|
|
||||||
}
|
}
|
||||||
}, {
|
};
|
||||||
key: '_adjustDialog',
|
|
||||||
value: function _adjustDialog() {
|
|
||||||
var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
|
|
||||||
|
|
||||||
if (!this._isBodyOverflowing && isModalOverflowing) {
|
Modal.prototype._resetAdjustments = function _resetAdjustments() {
|
||||||
this._element.style.paddingLeft = this._scrollbarWidth + 'px';
|
this._element.style.paddingLeft = '';
|
||||||
|
this._element.style.paddingRight = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
Modal.prototype._checkScrollbar = function _checkScrollbar() {
|
||||||
|
this._isBodyOverflowing = document.body.clientWidth < window.innerWidth;
|
||||||
|
this._scrollbarWidth = this._getScrollbarWidth();
|
||||||
|
};
|
||||||
|
|
||||||
|
Modal.prototype._setScrollbar = function _setScrollbar() {
|
||||||
|
var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10);
|
||||||
|
|
||||||
|
this._originalBodyPadding = document.body.style.paddingRight || '';
|
||||||
|
|
||||||
|
if (this._isBodyOverflowing) {
|
||||||
|
document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Modal.prototype._resetScrollbar = function _resetScrollbar() {
|
||||||
|
document.body.style.paddingRight = this._originalBodyPadding;
|
||||||
|
};
|
||||||
|
|
||||||
|
Modal.prototype._getScrollbarWidth = function _getScrollbarWidth() {
|
||||||
|
// thx d.walsh
|
||||||
|
var scrollDiv = document.createElement('div');
|
||||||
|
scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
|
||||||
|
document.body.appendChild(scrollDiv);
|
||||||
|
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
||||||
|
document.body.removeChild(scrollDiv);
|
||||||
|
return scrollbarWidth;
|
||||||
|
};
|
||||||
|
|
||||||
|
// static
|
||||||
|
|
||||||
|
Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
|
||||||
|
return this.each(function () {
|
||||||
|
var data = $(this).data(DATA_KEY);
|
||||||
|
var _config = $.extend({}, Modal.Default, $(this).data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Modal(this, _config);
|
||||||
|
$(this).data(DATA_KEY, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._isBodyOverflowing && !isModalOverflowing) {
|
if (typeof config === 'string') {
|
||||||
this._element.style.paddingRight = this._scrollbarWidth + 'px';
|
if (data[config] === undefined) {
|
||||||
}
|
throw new Error('No method named "' + config + '"');
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_resetAdjustments',
|
|
||||||
value: function _resetAdjustments() {
|
|
||||||
this._element.style.paddingLeft = '';
|
|
||||||
this._element.style.paddingRight = '';
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_checkScrollbar',
|
|
||||||
value: function _checkScrollbar() {
|
|
||||||
this._isBodyOverflowing = document.body.clientWidth < window.innerWidth;
|
|
||||||
this._scrollbarWidth = this._getScrollbarWidth();
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_setScrollbar',
|
|
||||||
value: function _setScrollbar() {
|
|
||||||
var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10);
|
|
||||||
|
|
||||||
this._originalBodyPadding = document.body.style.paddingRight || '';
|
|
||||||
|
|
||||||
if (this._isBodyOverflowing) {
|
|
||||||
document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_resetScrollbar',
|
|
||||||
value: function _resetScrollbar() {
|
|
||||||
document.body.style.paddingRight = this._originalBodyPadding;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_getScrollbarWidth',
|
|
||||||
value: function _getScrollbarWidth() {
|
|
||||||
// thx d.walsh
|
|
||||||
var scrollDiv = document.createElement('div');
|
|
||||||
scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
|
|
||||||
document.body.appendChild(scrollDiv);
|
|
||||||
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
|
||||||
document.body.removeChild(scrollDiv);
|
|
||||||
return scrollbarWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
|
||||||
|
|
||||||
}], [{
|
|
||||||
key: '_jQueryInterface',
|
|
||||||
value: function _jQueryInterface(config, relatedTarget) {
|
|
||||||
return this.each(function () {
|
|
||||||
var data = $(this).data(DATA_KEY);
|
|
||||||
var _config = $.extend({}, Modal.Default, $(this).data(), typeof config === 'object' && config);
|
|
||||||
|
|
||||||
if (!data) {
|
|
||||||
data = new Modal(this, _config);
|
|
||||||
$(this).data(DATA_KEY, data);
|
|
||||||
}
|
}
|
||||||
|
data[config](relatedTarget);
|
||||||
|
} else if (_config.show) {
|
||||||
|
data.show(relatedTarget);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
_createClass(Modal, null, [{
|
||||||
if (data[config] === undefined) {
|
|
||||||
throw new Error('No method named "' + config + '"');
|
|
||||||
}
|
|
||||||
data[config](relatedTarget);
|
|
||||||
} else if (_config.show) {
|
|
||||||
data.show(relatedTarget);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'VERSION',
|
key: 'VERSION',
|
||||||
get: function get() {
|
get: function get() {
|
||||||
return VERSION;
|
return VERSION;
|
||||||
|
@ -481,12 +451,18 @@ var Modal = (function ($) {
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return Modal;
|
return Modal;
|
||||||
})();
|
}();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||||
var _this7 = this;
|
var _this7 = this;
|
||||||
|
|
||||||
var target = undefined;
|
var target = void 0;
|
||||||
var selector = Util.getSelectorFromElement(this);
|
var selector = Util.getSelectorFromElement(this);
|
||||||
|
|
||||||
if (selector) {
|
if (selector) {
|
||||||
|
@ -529,5 +505,5 @@ var Modal = (function ($) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return Modal;
|
return Modal;
|
||||||
})(jQuery);
|
}(jQuery);
|
||||||
//# sourceMappingURL=modal.js.map
|
//# sourceMappingURL=modal.js.map
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,12 +1,12 @@
|
||||||
'use strict';
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||||
|
|
||||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||||
|
|
||||||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||||
|
|
||||||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
|
@ -15,7 +15,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== 'function'
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Popover = (function ($) {
|
var Popover = function ($) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
@ -70,85 +70,72 @@ var Popover = (function ($) {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Popover = (function (_Tooltip) {
|
var Popover = function (_Tooltip) {
|
||||||
_inherits(Popover, _Tooltip);
|
_inherits(Popover, _Tooltip);
|
||||||
|
|
||||||
function Popover() {
|
function Popover() {
|
||||||
_classCallCheck(this, Popover);
|
_classCallCheck(this, Popover);
|
||||||
|
|
||||||
_get(Object.getPrototypeOf(Popover.prototype), 'constructor', this).apply(this, arguments);
|
return _possibleConstructorReturn(this, _Tooltip.apply(this, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// overrides
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* jQuery
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
_createClass(Popover, [{
|
Popover.prototype.isWithContent = function isWithContent() {
|
||||||
key: 'isWithContent',
|
return this.getTitle() || this._getContent();
|
||||||
|
};
|
||||||
|
|
||||||
// overrides
|
Popover.prototype.getTipElement = function getTipElement() {
|
||||||
|
return this.tip = this.tip || $(this.config.template)[0];
|
||||||
|
};
|
||||||
|
|
||||||
value: function isWithContent() {
|
Popover.prototype.setContent = function setContent() {
|
||||||
return this.getTitle() || this._getContent();
|
var $tip = $(this.getTipElement());
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'getTipElement',
|
|
||||||
value: function getTipElement() {
|
|
||||||
return this.tip = this.tip || $(this.config.template)[0];
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'setContent',
|
|
||||||
value: function setContent() {
|
|
||||||
var $tip = $(this.getTipElement());
|
|
||||||
|
|
||||||
// we use append for html objects to maintain js events
|
// we use append for html objects to maintain js events
|
||||||
this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
|
this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
|
||||||
this.setElementContent($tip.find(Selector.CONTENT), this._getContent());
|
this.setElementContent($tip.find(Selector.CONTENT), this._getContent());
|
||||||
|
|
||||||
$tip.removeClass(ClassName.FADE).removeClass(ClassName.IN);
|
$tip.removeClass(ClassName.FADE).removeClass(ClassName.IN);
|
||||||
|
|
||||||
this.cleanupTether();
|
this.cleanupTether();
|
||||||
}
|
};
|
||||||
|
|
||||||
// private
|
// private
|
||||||
|
|
||||||
}, {
|
Popover.prototype._getContent = function _getContent() {
|
||||||
key: '_getContent',
|
return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content);
|
||||||
value: function _getContent() {
|
};
|
||||||
return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content);
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
||||||
}], [{
|
Popover._jQueryInterface = function _jQueryInterface(config) {
|
||||||
key: '_jQueryInterface',
|
return this.each(function () {
|
||||||
value: function _jQueryInterface(config) {
|
var data = $(this).data(DATA_KEY);
|
||||||
return this.each(function () {
|
var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null;
|
||||||
var data = $(this).data(DATA_KEY);
|
|
||||||
var _config = typeof config === 'object' ? config : null;
|
|
||||||
|
|
||||||
if (!data && /destroy|hide/.test(config)) {
|
if (!data && /destroy|hide/.test(config)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new Popover(this, _config);
|
||||||
|
$(this).data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (data[config] === undefined) {
|
||||||
|
throw new Error('No method named "' + config + '"');
|
||||||
}
|
}
|
||||||
|
data[config]();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
if (!data) {
|
_createClass(Popover, null, [{
|
||||||
data = new Popover(this, _config);
|
|
||||||
$(this).data(DATA_KEY, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
|
||||||
if (data[config] === undefined) {
|
|
||||||
throw new Error('No method named "' + config + '"');
|
|
||||||
}
|
|
||||||
data[config]();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'VERSION',
|
key: 'VERSION',
|
||||||
|
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
|
|
||||||
get: function get() {
|
get: function get() {
|
||||||
|
@ -187,7 +174,13 @@ var Popover = (function ($) {
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return Popover;
|
return Popover;
|
||||||
})(Tooltip);
|
}(Tooltip);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
$.fn[NAME] = Popover._jQueryInterface;
|
$.fn[NAME] = Popover._jQueryInterface;
|
||||||
$.fn[NAME].Constructor = Popover;
|
$.fn[NAME].Constructor = Popover;
|
||||||
|
@ -197,5 +190,5 @@ var Popover = (function ($) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return Popover;
|
return Popover;
|
||||||
})(jQuery);
|
}(jQuery);
|
||||||
//# sourceMappingURL=popover.js.map
|
//# sourceMappingURL=popover.js.map
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,8 +1,8 @@
|
||||||
'use strict';
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||||
|
|
||||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
|
@ -11,7 +11,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var ScrollSpy = (function ($) {
|
var ScrollSpy = function ($) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
@ -75,7 +75,7 @@ var ScrollSpy = (function ($) {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var ScrollSpy = (function () {
|
var ScrollSpy = function () {
|
||||||
function ScrollSpy(element, config) {
|
function ScrollSpy(element, config) {
|
||||||
_classCallCheck(this, ScrollSpy);
|
_classCallCheck(this, ScrollSpy);
|
||||||
|
|
||||||
|
@ -94,192 +94,174 @@ var ScrollSpy = (function ($) {
|
||||||
this._process();
|
this._process();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Data Api implementation
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
|
|
||||||
_createClass(ScrollSpy, [{
|
// public
|
||||||
key: 'refresh',
|
|
||||||
|
|
||||||
// public
|
ScrollSpy.prototype.refresh = function refresh() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
value: function refresh() {
|
var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET;
|
||||||
var _this = this;
|
|
||||||
|
|
||||||
var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET;
|
var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
|
||||||
|
|
||||||
var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
|
var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
|
||||||
|
|
||||||
var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
|
this._offsets = [];
|
||||||
|
this._targets = [];
|
||||||
|
|
||||||
this._offsets = [];
|
this._scrollHeight = this._getScrollHeight();
|
||||||
this._targets = [];
|
|
||||||
|
|
||||||
this._scrollHeight = this._getScrollHeight();
|
var targets = $.makeArray($(this._selector));
|
||||||
|
|
||||||
var targets = $.makeArray($(this._selector));
|
targets.map(function (element) {
|
||||||
|
var target = void 0;
|
||||||
|
var targetSelector = Util.getSelectorFromElement(element);
|
||||||
|
|
||||||
targets.map(function (element) {
|
if (targetSelector) {
|
||||||
var target = undefined;
|
target = $(targetSelector)[0];
|
||||||
var targetSelector = Util.getSelectorFromElement(element);
|
}
|
||||||
|
|
||||||
if (targetSelector) {
|
if (target && (target.offsetWidth || target.offsetHeight)) {
|
||||||
target = $(targetSelector)[0];
|
// todo (fat): remove sketch reliance on jQuery position/offset
|
||||||
}
|
return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}).filter(function (item) {
|
||||||
|
return item;
|
||||||
|
}).sort(function (a, b) {
|
||||||
|
return a[0] - b[0];
|
||||||
|
}).forEach(function (item) {
|
||||||
|
_this._offsets.push(item[0]);
|
||||||
|
_this._targets.push(item[1]);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
if (target && (target.offsetWidth || target.offsetHeight)) {
|
ScrollSpy.prototype.dispose = function dispose() {
|
||||||
// todo (fat): remove sketch reliance on jQuery position/offset
|
$.removeData(this._element, DATA_KEY);
|
||||||
return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
|
$(this._scrollElement).off(EVENT_KEY);
|
||||||
}
|
|
||||||
return null;
|
this._element = null;
|
||||||
}).filter(function (item) {
|
this._scrollElement = null;
|
||||||
return item;
|
this._config = null;
|
||||||
}).sort(function (a, b) {
|
this._selector = null;
|
||||||
return a[0] - b[0];
|
this._offsets = null;
|
||||||
}).forEach(function (item) {
|
this._targets = null;
|
||||||
_this._offsets.push(item[0]);
|
this._activeTarget = null;
|
||||||
_this._targets.push(item[1]);
|
this._scrollHeight = null;
|
||||||
});
|
};
|
||||||
|
|
||||||
|
// private
|
||||||
|
|
||||||
|
ScrollSpy.prototype._getConfig = function _getConfig(config) {
|
||||||
|
config = $.extend({}, Default, config);
|
||||||
|
|
||||||
|
if (typeof config.target !== 'string') {
|
||||||
|
var id = $(config.target).attr('id');
|
||||||
|
if (!id) {
|
||||||
|
id = Util.getUID(NAME);
|
||||||
|
$(config.target).attr('id', id);
|
||||||
|
}
|
||||||
|
config.target = '#' + id;
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
key: 'dispose',
|
|
||||||
value: function dispose() {
|
|
||||||
$.removeData(this._element, DATA_KEY);
|
|
||||||
$(this._scrollElement).off(EVENT_KEY);
|
|
||||||
|
|
||||||
this._element = null;
|
Util.typeCheckConfig(NAME, config, DefaultType);
|
||||||
this._scrollElement = null;
|
|
||||||
this._config = null;
|
return config;
|
||||||
this._selector = null;
|
};
|
||||||
this._offsets = null;
|
|
||||||
this._targets = null;
|
ScrollSpy.prototype._getScrollTop = function _getScrollTop() {
|
||||||
|
return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop;
|
||||||
|
};
|
||||||
|
|
||||||
|
ScrollSpy.prototype._getScrollHeight = function _getScrollHeight() {
|
||||||
|
return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
|
||||||
|
};
|
||||||
|
|
||||||
|
ScrollSpy.prototype._process = function _process() {
|
||||||
|
var scrollTop = this._getScrollTop() + this._config.offset;
|
||||||
|
var scrollHeight = this._getScrollHeight();
|
||||||
|
var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight;
|
||||||
|
|
||||||
|
if (this._scrollHeight !== scrollHeight) {
|
||||||
|
this.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (scrollTop >= maxScroll) {
|
||||||
|
var target = this._targets[this._targets.length - 1];
|
||||||
|
|
||||||
|
if (this._activeTarget !== target) {
|
||||||
|
this._activate(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._activeTarget && scrollTop < this._offsets[0]) {
|
||||||
this._activeTarget = null;
|
this._activeTarget = null;
|
||||||
this._scrollHeight = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// private
|
|
||||||
|
|
||||||
}, {
|
|
||||||
key: '_getConfig',
|
|
||||||
value: function _getConfig(config) {
|
|
||||||
config = $.extend({}, Default, config);
|
|
||||||
|
|
||||||
if (typeof config.target !== 'string') {
|
|
||||||
var id = $(config.target).attr('id');
|
|
||||||
if (!id) {
|
|
||||||
id = Util.getUID(NAME);
|
|
||||||
$(config.target).attr('id', id);
|
|
||||||
}
|
|
||||||
config.target = '#' + id;
|
|
||||||
}
|
|
||||||
|
|
||||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
|
||||||
|
|
||||||
return config;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_getScrollTop',
|
|
||||||
value: function _getScrollTop() {
|
|
||||||
return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_getScrollHeight',
|
|
||||||
value: function _getScrollHeight() {
|
|
||||||
return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_process',
|
|
||||||
value: function _process() {
|
|
||||||
var scrollTop = this._getScrollTop() + this._config.offset;
|
|
||||||
var scrollHeight = this._getScrollHeight();
|
|
||||||
var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight;
|
|
||||||
|
|
||||||
if (this._scrollHeight !== scrollHeight) {
|
|
||||||
this.refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (scrollTop >= maxScroll) {
|
|
||||||
var target = this._targets[this._targets.length - 1];
|
|
||||||
|
|
||||||
if (this._activeTarget !== target) {
|
|
||||||
this._activate(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._activeTarget && scrollTop < this._offsets[0]) {
|
|
||||||
this._activeTarget = null;
|
|
||||||
this._clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = this._offsets.length; i--;) {
|
|
||||||
var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (this._offsets[i + 1] === undefined || scrollTop < this._offsets[i + 1]);
|
|
||||||
|
|
||||||
if (isActiveTarget) {
|
|
||||||
this._activate(this._targets[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_activate',
|
|
||||||
value: function _activate(target) {
|
|
||||||
this._activeTarget = target;
|
|
||||||
|
|
||||||
this._clear();
|
this._clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var queries = this._selector.split(',');
|
for (var i = this._offsets.length; i--;) {
|
||||||
queries = queries.map(function (selector) {
|
var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (this._offsets[i + 1] === undefined || scrollTop < this._offsets[i + 1]);
|
||||||
return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]');
|
|
||||||
});
|
|
||||||
|
|
||||||
var $link = $(queries.join(','));
|
if (isActiveTarget) {
|
||||||
|
this._activate(this._targets[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
|
ScrollSpy.prototype._activate = function _activate(target) {
|
||||||
$link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
|
this._activeTarget = target;
|
||||||
$link.addClass(ClassName.ACTIVE);
|
|
||||||
} else {
|
this._clear();
|
||||||
// todo (fat) this is kinda sus...
|
|
||||||
// recursively add actives to tested nav-links
|
var queries = this._selector.split(',');
|
||||||
$link.parents(Selector.LI).find(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
|
queries = queries.map(function (selector) {
|
||||||
|
return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]');
|
||||||
|
});
|
||||||
|
|
||||||
|
var $link = $(queries.join(','));
|
||||||
|
|
||||||
|
if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
|
||||||
|
$link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
|
||||||
|
$link.addClass(ClassName.ACTIVE);
|
||||||
|
} else {
|
||||||
|
// todo (fat) this is kinda sus...
|
||||||
|
// recursively add actives to tested nav-links
|
||||||
|
$link.parents(Selector.LI).find(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._scrollElement).trigger(Event.ACTIVATE, {
|
||||||
|
relatedTarget: target
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
ScrollSpy.prototype._clear = function _clear() {
|
||||||
|
$(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
|
||||||
|
};
|
||||||
|
|
||||||
|
// static
|
||||||
|
|
||||||
|
ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var data = $(this).data(DATA_KEY);
|
||||||
|
var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config || null;
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = new ScrollSpy(this, _config);
|
||||||
|
$(this).data(DATA_KEY, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._scrollElement).trigger(Event.ACTIVATE, {
|
if (typeof config === 'string') {
|
||||||
relatedTarget: target
|
if (data[config] === undefined) {
|
||||||
});
|
throw new Error('No method named "' + config + '"');
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_clear',
|
|
||||||
value: function _clear() {
|
|
||||||
$(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
|
||||||
|
|
||||||
}], [{
|
|
||||||
key: '_jQueryInterface',
|
|
||||||
value: function _jQueryInterface(config) {
|
|
||||||
return this.each(function () {
|
|
||||||
var data = $(this).data(DATA_KEY);
|
|
||||||
var _config = typeof config === 'object' && config || null;
|
|
||||||
|
|
||||||
if (!data) {
|
|
||||||
data = new ScrollSpy(this, _config);
|
|
||||||
$(this).data(DATA_KEY, data);
|
|
||||||
}
|
}
|
||||||
|
data[config]();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
_createClass(ScrollSpy, null, [{
|
||||||
if (data[config] === undefined) {
|
|
||||||
throw new Error('No method named "' + config + '"');
|
|
||||||
}
|
|
||||||
data[config]();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'VERSION',
|
key: 'VERSION',
|
||||||
get: function get() {
|
get: function get() {
|
||||||
return VERSION;
|
return VERSION;
|
||||||
|
@ -292,7 +274,13 @@ var ScrollSpy = (function ($) {
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return ScrollSpy;
|
return ScrollSpy;
|
||||||
})();
|
}();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
$(window).on(Event.LOAD_DATA_API, function () {
|
$(window).on(Event.LOAD_DATA_API, function () {
|
||||||
var scrollSpys = $.makeArray($(Selector.DATA_SPY));
|
var scrollSpys = $.makeArray($(Selector.DATA_SPY));
|
||||||
|
@ -317,5 +305,5 @@ var ScrollSpy = (function ($) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return ScrollSpy;
|
return ScrollSpy;
|
||||||
})(jQuery);
|
}(jQuery);
|
||||||
//# sourceMappingURL=scrollspy.js.map
|
//# sourceMappingURL=scrollspy.js.map
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,8 +1,6 @@
|
||||||
'use strict';
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||||
|
|
||||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
|
@ -11,7 +9,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Tab = (function ($) {
|
var Tab = function ($) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
@ -61,176 +59,162 @@ var Tab = (function ($) {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Tab = (function () {
|
var Tab = function () {
|
||||||
function Tab(element) {
|
function Tab(element) {
|
||||||
_classCallCheck(this, Tab);
|
_classCallCheck(this, Tab);
|
||||||
|
|
||||||
this._element = element;
|
this._element = element;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Data Api implementation
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
|
|
||||||
_createClass(Tab, [{
|
// public
|
||||||
key: 'show',
|
|
||||||
|
|
||||||
// public
|
Tab.prototype.show = function show() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
value: function show() {
|
if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE)) {
|
||||||
var _this = this;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE)) {
|
var target = void 0;
|
||||||
return;
|
var previous = void 0;
|
||||||
}
|
var ulElement = $(this._element).closest(Selector.UL)[0];
|
||||||
|
var selector = Util.getSelectorFromElement(this._element);
|
||||||
|
|
||||||
var target = undefined;
|
if (ulElement) {
|
||||||
var previous = undefined;
|
previous = $.makeArray($(ulElement).find(Selector.ACTIVE));
|
||||||
var ulElement = $(this._element).closest(Selector.UL)[0];
|
previous = previous[previous.length - 1];
|
||||||
var selector = Util.getSelectorFromElement(this._element);
|
}
|
||||||
|
|
||||||
if (ulElement) {
|
var hideEvent = $.Event(Event.HIDE, {
|
||||||
previous = $.makeArray($(ulElement).find(Selector.ACTIVE));
|
relatedTarget: this._element
|
||||||
previous = previous[previous.length - 1];
|
});
|
||||||
}
|
|
||||||
|
|
||||||
var hideEvent = $.Event(Event.HIDE, {
|
var showEvent = $.Event(Event.SHOW, {
|
||||||
relatedTarget: this._element
|
relatedTarget: previous
|
||||||
|
});
|
||||||
|
|
||||||
|
if (previous) {
|
||||||
|
$(previous).trigger(hideEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._element).trigger(showEvent);
|
||||||
|
|
||||||
|
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selector) {
|
||||||
|
target = $(selector)[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
this._activate(this._element, ulElement);
|
||||||
|
|
||||||
|
var complete = function complete() {
|
||||||
|
var hiddenEvent = $.Event(Event.HIDDEN, {
|
||||||
|
relatedTarget: _this._element
|
||||||
});
|
});
|
||||||
|
|
||||||
var showEvent = $.Event(Event.SHOW, {
|
var shownEvent = $.Event(Event.SHOWN, {
|
||||||
relatedTarget: previous
|
relatedTarget: previous
|
||||||
});
|
});
|
||||||
|
|
||||||
if (previous) {
|
$(previous).trigger(hiddenEvent);
|
||||||
$(previous).trigger(hideEvent);
|
$(_this._element).trigger(shownEvent);
|
||||||
}
|
};
|
||||||
|
|
||||||
$(this._element).trigger(showEvent);
|
if (target) {
|
||||||
|
this._activate(target, target.parentNode, complete);
|
||||||
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
|
} else {
|
||||||
return;
|
complete();
|
||||||
}
|
|
||||||
|
|
||||||
if (selector) {
|
|
||||||
target = $(selector)[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
this._activate(this._element, ulElement);
|
|
||||||
|
|
||||||
var complete = function complete() {
|
|
||||||
var hiddenEvent = $.Event(Event.HIDDEN, {
|
|
||||||
relatedTarget: _this._element
|
|
||||||
});
|
|
||||||
|
|
||||||
var shownEvent = $.Event(Event.SHOWN, {
|
|
||||||
relatedTarget: previous
|
|
||||||
});
|
|
||||||
|
|
||||||
$(previous).trigger(hiddenEvent);
|
|
||||||
$(_this._element).trigger(shownEvent);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (target) {
|
|
||||||
this._activate(target, target.parentNode, complete);
|
|
||||||
} else {
|
|
||||||
complete();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, {
|
};
|
||||||
key: 'dispose',
|
|
||||||
value: function dispose() {
|
Tab.prototype.dispose = function dispose() {
|
||||||
$.removeClass(this._element, DATA_KEY);
|
$.removeClass(this._element, DATA_KEY);
|
||||||
this._element = null;
|
this._element = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
// private
|
||||||
|
|
||||||
|
Tab.prototype._activate = function _activate(element, container, callback) {
|
||||||
|
var active = $(container).find(Selector.ACTIVE_CHILD)[0];
|
||||||
|
var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0]));
|
||||||
|
|
||||||
|
var complete = $.proxy(this._transitionComplete, this, element, active, isTransitioning, callback);
|
||||||
|
|
||||||
|
if (active && isTransitioning) {
|
||||||
|
$(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
||||||
|
} else {
|
||||||
|
complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
// private
|
if (active) {
|
||||||
|
$(active).removeClass(ClassName.IN);
|
||||||
}, {
|
|
||||||
key: '_activate',
|
|
||||||
value: function _activate(element, container, callback) {
|
|
||||||
var active = $(container).find(Selector.ACTIVE_CHILD)[0];
|
|
||||||
var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0]));
|
|
||||||
|
|
||||||
var complete = $.proxy(this._transitionComplete, this, element, active, isTransitioning, callback);
|
|
||||||
|
|
||||||
if (active && isTransitioning) {
|
|
||||||
$(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
|
||||||
} else {
|
|
||||||
complete();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (active) {
|
|
||||||
$(active).removeClass(ClassName.IN);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, {
|
};
|
||||||
key: '_transitionComplete',
|
|
||||||
value: function _transitionComplete(element, active, isTransitioning, callback) {
|
|
||||||
if (active) {
|
|
||||||
$(active).removeClass(ClassName.ACTIVE);
|
|
||||||
|
|
||||||
var dropdownChild = $(active).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
|
Tab.prototype._transitionComplete = function _transitionComplete(element, active, isTransitioning, callback) {
|
||||||
|
if (active) {
|
||||||
|
$(active).removeClass(ClassName.ACTIVE);
|
||||||
|
|
||||||
if (dropdownChild) {
|
var dropdownChild = $(active).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
|
||||||
$(dropdownChild).removeClass(ClassName.ACTIVE);
|
|
||||||
}
|
|
||||||
|
|
||||||
active.setAttribute('aria-expanded', false);
|
if (dropdownChild) {
|
||||||
|
$(dropdownChild).removeClass(ClassName.ACTIVE);
|
||||||
|
}
|
||||||
|
|
||||||
|
active.setAttribute('aria-expanded', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(element).addClass(ClassName.ACTIVE);
|
||||||
|
element.setAttribute('aria-expanded', true);
|
||||||
|
|
||||||
|
if (isTransitioning) {
|
||||||
|
Util.reflow(element);
|
||||||
|
$(element).addClass(ClassName.IN);
|
||||||
|
} else {
|
||||||
|
$(element).removeClass(ClassName.FADE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
|
||||||
|
|
||||||
|
var dropdownElement = $(element).closest(Selector.DROPDOWN)[0];
|
||||||
|
if (dropdownElement) {
|
||||||
|
$(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(element).addClass(ClassName.ACTIVE);
|
|
||||||
element.setAttribute('aria-expanded', true);
|
element.setAttribute('aria-expanded', true);
|
||||||
|
|
||||||
if (isTransitioning) {
|
|
||||||
Util.reflow(element);
|
|
||||||
$(element).addClass(ClassName.IN);
|
|
||||||
} else {
|
|
||||||
$(element).removeClass(ClassName.FADE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
|
|
||||||
|
|
||||||
var dropdownElement = $(element).closest(Selector.DROPDOWN)[0];
|
|
||||||
if (dropdownElement) {
|
|
||||||
$(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
|
|
||||||
}
|
|
||||||
|
|
||||||
element.setAttribute('aria-expanded', true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (callback) {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
if (callback) {
|
||||||
|
callback();
|
||||||
}], [{
|
|
||||||
key: '_jQueryInterface',
|
|
||||||
value: function _jQueryInterface(config) {
|
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this);
|
|
||||||
var data = $this.data(DATA_KEY);
|
|
||||||
|
|
||||||
if (!data) {
|
|
||||||
data = data = new Tab(this);
|
|
||||||
$this.data(DATA_KEY, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
|
||||||
if (data[config] === undefined) {
|
|
||||||
throw new Error('No method named "' + config + '"');
|
|
||||||
}
|
|
||||||
data[config]();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}, {
|
};
|
||||||
|
|
||||||
|
// static
|
||||||
|
|
||||||
|
Tab._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this);
|
||||||
|
var data = $this.data(DATA_KEY);
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
data = data = new Tab(this);
|
||||||
|
$this.data(DATA_KEY, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof config === 'string') {
|
||||||
|
if (data[config] === undefined) {
|
||||||
|
throw new Error('No method named "' + config + '"');
|
||||||
|
}
|
||||||
|
data[config]();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_createClass(Tab, null, [{
|
||||||
key: 'VERSION',
|
key: 'VERSION',
|
||||||
get: function get() {
|
get: function get() {
|
||||||
return VERSION;
|
return VERSION;
|
||||||
|
@ -238,7 +222,13 @@ var Tab = (function ($) {
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return Tab;
|
return Tab;
|
||||||
})();
|
}();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Data Api implementation
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -259,5 +249,5 @@ var Tab = (function ($) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return Tab;
|
return Tab;
|
||||||
})(jQuery);
|
}(jQuery);
|
||||||
//# sourceMappingURL=tab.js.map
|
//# sourceMappingURL=tab.js.map
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,10 +1,8 @@
|
||||||
/* global Tether */
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||||
|
|
||||||
'use strict';
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||||
|
|
||||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
|
@ -13,7 +11,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Tooltip = (function ($) {
|
var Tooltip = function ($) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check for Tether dependency
|
* Check for Tether dependency
|
||||||
|
@ -116,7 +114,7 @@ var Tooltip = (function ($) {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Tooltip = (function () {
|
var Tooltip = function () {
|
||||||
function Tooltip(element, config) {
|
function Tooltip(element, config) {
|
||||||
_classCallCheck(this, Tooltip);
|
_classCallCheck(this, Tooltip);
|
||||||
|
|
||||||
|
@ -135,439 +133,407 @@ var Tooltip = (function ($) {
|
||||||
this._setListeners();
|
this._setListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* jQuery
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
|
|
||||||
_createClass(Tooltip, [{
|
// public
|
||||||
key: 'enable',
|
|
||||||
|
|
||||||
// public
|
Tooltip.prototype.enable = function enable() {
|
||||||
|
this._isEnabled = true;
|
||||||
|
};
|
||||||
|
|
||||||
value: function enable() {
|
Tooltip.prototype.disable = function disable() {
|
||||||
this._isEnabled = true;
|
this._isEnabled = false;
|
||||||
}
|
};
|
||||||
}, {
|
|
||||||
key: 'disable',
|
|
||||||
value: function disable() {
|
|
||||||
this._isEnabled = false;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'toggleEnabled',
|
|
||||||
value: function toggleEnabled() {
|
|
||||||
this._isEnabled = !this._isEnabled;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'toggle',
|
|
||||||
value: function toggle(event) {
|
|
||||||
if (event) {
|
|
||||||
var dataKey = this.constructor.DATA_KEY;
|
|
||||||
var context = $(event.currentTarget).data(dataKey);
|
|
||||||
|
|
||||||
if (!context) {
|
Tooltip.prototype.toggleEnabled = function toggleEnabled() {
|
||||||
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
this._isEnabled = !this._isEnabled;
|
||||||
$(event.currentTarget).data(dataKey, context);
|
};
|
||||||
}
|
|
||||||
|
|
||||||
context._activeTrigger.click = !context._activeTrigger.click;
|
Tooltip.prototype.toggle = function toggle(event) {
|
||||||
|
if (event) {
|
||||||
|
var dataKey = this.constructor.DATA_KEY;
|
||||||
|
var context = $(event.currentTarget).data(dataKey);
|
||||||
|
|
||||||
if (context._isWithActiveTrigger()) {
|
if (!context) {
|
||||||
context._enter(null, context);
|
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
||||||
} else {
|
$(event.currentTarget).data(dataKey, context);
|
||||||
context._leave(null, context);
|
}
|
||||||
}
|
|
||||||
|
context._activeTrigger.click = !context._activeTrigger.click;
|
||||||
|
|
||||||
|
if (context._isWithActiveTrigger()) {
|
||||||
|
context._enter(null, context);
|
||||||
} else {
|
} else {
|
||||||
|
context._leave(null, context);
|
||||||
if ($(this.getTipElement()).hasClass(ClassName.IN)) {
|
|
||||||
this._leave(null, this);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this._enter(null, this);
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
}, {
|
|
||||||
key: 'dispose',
|
|
||||||
value: function dispose() {
|
|
||||||
clearTimeout(this._timeout);
|
|
||||||
|
|
||||||
this.cleanupTether();
|
if ($(this.getTipElement()).hasClass(ClassName.IN)) {
|
||||||
|
this._leave(null, this);
|
||||||
$.removeData(this.element, this.constructor.DATA_KEY);
|
return;
|
||||||
|
|
||||||
$(this.element).off(this.constructor.EVENT_KEY);
|
|
||||||
|
|
||||||
if (this.tip) {
|
|
||||||
$(this.tip).remove();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this._isEnabled = null;
|
this._enter(null, this);
|
||||||
this._timeout = null;
|
|
||||||
this._hoverState = null;
|
|
||||||
this._activeTrigger = null;
|
|
||||||
this._tether = null;
|
|
||||||
|
|
||||||
this.element = null;
|
|
||||||
this.config = null;
|
|
||||||
this.tip = null;
|
|
||||||
}
|
}
|
||||||
}, {
|
};
|
||||||
key: 'show',
|
|
||||||
value: function show() {
|
|
||||||
var _this = this;
|
|
||||||
|
|
||||||
var showEvent = $.Event(this.constructor.Event.SHOW);
|
Tooltip.prototype.dispose = function dispose() {
|
||||||
|
clearTimeout(this._timeout);
|
||||||
|
|
||||||
if (this.isWithContent() && this._isEnabled) {
|
this.cleanupTether();
|
||||||
$(this.element).trigger(showEvent);
|
|
||||||
|
|
||||||
var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
|
$.removeData(this.element, this.constructor.DATA_KEY);
|
||||||
|
|
||||||
if (showEvent.isDefaultPrevented() || !isInTheDom) {
|
$(this.element).off(this.constructor.EVENT_KEY);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var tip = this.getTipElement();
|
if (this.tip) {
|
||||||
var tipId = Util.getUID(this.constructor.NAME);
|
$(this.tip).remove();
|
||||||
|
}
|
||||||
|
|
||||||
tip.setAttribute('id', tipId);
|
this._isEnabled = null;
|
||||||
this.element.setAttribute('aria-describedby', tipId);
|
this._timeout = null;
|
||||||
|
this._hoverState = null;
|
||||||
|
this._activeTrigger = null;
|
||||||
|
this._tether = null;
|
||||||
|
|
||||||
this.setContent();
|
this.element = null;
|
||||||
|
this.config = null;
|
||||||
|
this.tip = null;
|
||||||
|
};
|
||||||
|
|
||||||
if (this.config.animation) {
|
Tooltip.prototype.show = function show() {
|
||||||
$(tip).addClass(ClassName.FADE);
|
var _this = this;
|
||||||
}
|
|
||||||
|
|
||||||
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
|
var showEvent = $.Event(this.constructor.Event.SHOW);
|
||||||
|
|
||||||
var attachment = this._getAttachment(placement);
|
if (this.isWithContent() && this._isEnabled) {
|
||||||
|
$(this.element).trigger(showEvent);
|
||||||
|
|
||||||
$(tip).data(this.constructor.DATA_KEY, this).appendTo(document.body);
|
var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
|
||||||
|
|
||||||
$(this.element).trigger(this.constructor.Event.INSERTED);
|
if (showEvent.isDefaultPrevented() || !isInTheDom) {
|
||||||
|
return;
|
||||||
this._tether = new Tether({
|
|
||||||
attachment: attachment,
|
|
||||||
element: tip,
|
|
||||||
target: this.element,
|
|
||||||
classes: TetherClass,
|
|
||||||
classPrefix: CLASS_PREFIX,
|
|
||||||
offset: this.config.offset,
|
|
||||||
constraints: this.config.constraints,
|
|
||||||
addTargetClasses: false
|
|
||||||
});
|
|
||||||
|
|
||||||
Util.reflow(tip);
|
|
||||||
this._tether.position();
|
|
||||||
|
|
||||||
$(tip).addClass(ClassName.IN);
|
|
||||||
|
|
||||||
var complete = function complete() {
|
|
||||||
var prevHoverState = _this._hoverState;
|
|
||||||
_this._hoverState = null;
|
|
||||||
|
|
||||||
$(_this.element).trigger(_this.constructor.Event.SHOWN);
|
|
||||||
|
|
||||||
if (prevHoverState === HoverState.OUT) {
|
|
||||||
_this._leave(null, _this);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
|
|
||||||
$(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
complete();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'hide',
|
|
||||||
value: function hide(callback) {
|
|
||||||
var _this2 = this;
|
|
||||||
|
|
||||||
var tip = this.getTipElement();
|
var tip = this.getTipElement();
|
||||||
var hideEvent = $.Event(this.constructor.Event.HIDE);
|
var tipId = Util.getUID(this.constructor.NAME);
|
||||||
|
|
||||||
|
tip.setAttribute('id', tipId);
|
||||||
|
this.element.setAttribute('aria-describedby', tipId);
|
||||||
|
|
||||||
|
this.setContent();
|
||||||
|
|
||||||
|
if (this.config.animation) {
|
||||||
|
$(tip).addClass(ClassName.FADE);
|
||||||
|
}
|
||||||
|
|
||||||
|
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
|
||||||
|
|
||||||
|
var attachment = this._getAttachment(placement);
|
||||||
|
|
||||||
|
$(tip).data(this.constructor.DATA_KEY, this).appendTo(document.body);
|
||||||
|
|
||||||
|
$(this.element).trigger(this.constructor.Event.INSERTED);
|
||||||
|
|
||||||
|
this._tether = new Tether({
|
||||||
|
attachment: attachment,
|
||||||
|
element: tip,
|
||||||
|
target: this.element,
|
||||||
|
classes: TetherClass,
|
||||||
|
classPrefix: CLASS_PREFIX,
|
||||||
|
offset: this.config.offset,
|
||||||
|
constraints: this.config.constraints,
|
||||||
|
addTargetClasses: false
|
||||||
|
});
|
||||||
|
|
||||||
|
Util.reflow(tip);
|
||||||
|
this._tether.position();
|
||||||
|
|
||||||
|
$(tip).addClass(ClassName.IN);
|
||||||
|
|
||||||
var complete = function complete() {
|
var complete = function complete() {
|
||||||
if (_this2._hoverState !== HoverState.IN && tip.parentNode) {
|
var prevHoverState = _this._hoverState;
|
||||||
tip.parentNode.removeChild(tip);
|
_this._hoverState = null;
|
||||||
}
|
|
||||||
|
|
||||||
_this2.element.removeAttribute('aria-describedby');
|
$(_this.element).trigger(_this.constructor.Event.SHOWN);
|
||||||
$(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
|
|
||||||
_this2.cleanupTether();
|
|
||||||
|
|
||||||
if (callback) {
|
if (prevHoverState === HoverState.OUT) {
|
||||||
callback();
|
_this._leave(null, _this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$(this.element).trigger(hideEvent);
|
|
||||||
|
|
||||||
if (hideEvent.isDefaultPrevented()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$(tip).removeClass(ClassName.IN);
|
|
||||||
|
|
||||||
if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
|
if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
|
||||||
|
$(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION);
|
||||||
$(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
|
||||||
} else {
|
|
||||||
complete();
|
|
||||||
}
|
|
||||||
|
|
||||||
this._hoverState = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// protected
|
|
||||||
|
|
||||||
}, {
|
|
||||||
key: 'isWithContent',
|
|
||||||
value: function isWithContent() {
|
|
||||||
return Boolean(this.getTitle());
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'getTipElement',
|
|
||||||
value: function getTipElement() {
|
|
||||||
return this.tip = this.tip || $(this.config.template)[0];
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'setContent',
|
|
||||||
value: function setContent() {
|
|
||||||
var $tip = $(this.getTipElement());
|
|
||||||
|
|
||||||
this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());
|
|
||||||
|
|
||||||
$tip.removeClass(ClassName.FADE).removeClass(ClassName.IN);
|
|
||||||
|
|
||||||
this.cleanupTether();
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'setElementContent',
|
|
||||||
value: function setElementContent($element, content) {
|
|
||||||
var html = this.config.html;
|
|
||||||
if (typeof content === 'object' && (content.nodeType || content.jquery)) {
|
|
||||||
// content is a DOM node or a jQuery
|
|
||||||
if (html) {
|
|
||||||
if (!$(content).parent().is($element)) {
|
|
||||||
$element.empty().append(content);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$element.text($(content).text());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$element[html ? 'html' : 'text'](content);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'getTitle',
|
|
||||||
value: function getTitle() {
|
|
||||||
var title = this.element.getAttribute('data-original-title');
|
|
||||||
|
|
||||||
if (!title) {
|
|
||||||
title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
|
|
||||||
}
|
|
||||||
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'cleanupTether',
|
|
||||||
value: function cleanupTether() {
|
|
||||||
if (this._tether) {
|
|
||||||
this._tether.destroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// private
|
|
||||||
|
|
||||||
}, {
|
|
||||||
key: '_getAttachment',
|
|
||||||
value: function _getAttachment(placement) {
|
|
||||||
return AttachmentMap[placement.toUpperCase()];
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_setListeners',
|
|
||||||
value: function _setListeners() {
|
|
||||||
var _this3 = this;
|
|
||||||
|
|
||||||
var triggers = this.config.trigger.split(' ');
|
|
||||||
|
|
||||||
triggers.forEach(function (trigger) {
|
|
||||||
if (trigger === 'click') {
|
|
||||||
$(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, $.proxy(_this3.toggle, _this3));
|
|
||||||
} else if (trigger !== Trigger.MANUAL) {
|
|
||||||
var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;
|
|
||||||
var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;
|
|
||||||
|
|
||||||
$(_this3.element).on(eventIn, _this3.config.selector, $.proxy(_this3._enter, _this3)).on(eventOut, _this3.config.selector, $.proxy(_this3._leave, _this3));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (this.config.selector) {
|
|
||||||
this.config = $.extend({}, this.config, {
|
|
||||||
trigger: 'manual',
|
|
||||||
selector: ''
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this._fixTitle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_fixTitle',
|
|
||||||
value: function _fixTitle() {
|
|
||||||
var titleType = typeof this.element.getAttribute('data-original-title');
|
|
||||||
if (this.element.getAttribute('title') || titleType !== 'string') {
|
|
||||||
this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
|
|
||||||
this.element.setAttribute('title', '');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_enter',
|
|
||||||
value: function _enter(event, context) {
|
|
||||||
var dataKey = this.constructor.DATA_KEY;
|
|
||||||
|
|
||||||
context = context || $(event.currentTarget).data(dataKey);
|
|
||||||
|
|
||||||
if (!context) {
|
|
||||||
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
|
||||||
$(event.currentTarget).data(dataKey, context);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event) {
|
|
||||||
context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($(context.getTipElement()).hasClass(ClassName.IN) || context._hoverState === HoverState.IN) {
|
|
||||||
context._hoverState = HoverState.IN;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearTimeout(context._timeout);
|
complete();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Tooltip.prototype.hide = function hide(callback) {
|
||||||
|
var _this2 = this;
|
||||||
|
|
||||||
|
var tip = this.getTipElement();
|
||||||
|
var hideEvent = $.Event(this.constructor.Event.HIDE);
|
||||||
|
var complete = function complete() {
|
||||||
|
if (_this2._hoverState !== HoverState.IN && tip.parentNode) {
|
||||||
|
tip.parentNode.removeChild(tip);
|
||||||
|
}
|
||||||
|
|
||||||
|
_this2.element.removeAttribute('aria-describedby');
|
||||||
|
$(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
|
||||||
|
_this2.cleanupTether();
|
||||||
|
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$(this.element).trigger(hideEvent);
|
||||||
|
|
||||||
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(tip).removeClass(ClassName.IN);
|
||||||
|
|
||||||
|
if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
|
||||||
|
|
||||||
|
$(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
||||||
|
} else {
|
||||||
|
complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._hoverState = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
// protected
|
||||||
|
|
||||||
|
Tooltip.prototype.isWithContent = function isWithContent() {
|
||||||
|
return Boolean(this.getTitle());
|
||||||
|
};
|
||||||
|
|
||||||
|
Tooltip.prototype.getTipElement = function getTipElement() {
|
||||||
|
return this.tip = this.tip || $(this.config.template)[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
Tooltip.prototype.setContent = function setContent() {
|
||||||
|
var $tip = $(this.getTipElement());
|
||||||
|
|
||||||
|
this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());
|
||||||
|
|
||||||
|
$tip.removeClass(ClassName.FADE).removeClass(ClassName.IN);
|
||||||
|
|
||||||
|
this.cleanupTether();
|
||||||
|
};
|
||||||
|
|
||||||
|
Tooltip.prototype.setElementContent = function setElementContent($element, content) {
|
||||||
|
var html = this.config.html;
|
||||||
|
if ((typeof content === 'undefined' ? 'undefined' : _typeof(content)) === 'object' && (content.nodeType || content.jquery)) {
|
||||||
|
// content is a DOM node or a jQuery
|
||||||
|
if (html) {
|
||||||
|
if (!$(content).parent().is($element)) {
|
||||||
|
$element.empty().append(content);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$element.text($(content).text());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$element[html ? 'html' : 'text'](content);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Tooltip.prototype.getTitle = function getTitle() {
|
||||||
|
var title = this.element.getAttribute('data-original-title');
|
||||||
|
|
||||||
|
if (!title) {
|
||||||
|
title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
|
||||||
|
}
|
||||||
|
|
||||||
|
return title;
|
||||||
|
};
|
||||||
|
|
||||||
|
Tooltip.prototype.cleanupTether = function cleanupTether() {
|
||||||
|
if (this._tether) {
|
||||||
|
this._tether.destroy();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// private
|
||||||
|
|
||||||
|
Tooltip.prototype._getAttachment = function _getAttachment(placement) {
|
||||||
|
return AttachmentMap[placement.toUpperCase()];
|
||||||
|
};
|
||||||
|
|
||||||
|
Tooltip.prototype._setListeners = function _setListeners() {
|
||||||
|
var _this3 = this;
|
||||||
|
|
||||||
|
var triggers = this.config.trigger.split(' ');
|
||||||
|
|
||||||
|
triggers.forEach(function (trigger) {
|
||||||
|
if (trigger === 'click') {
|
||||||
|
$(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, $.proxy(_this3.toggle, _this3));
|
||||||
|
} else if (trigger !== Trigger.MANUAL) {
|
||||||
|
var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;
|
||||||
|
var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;
|
||||||
|
|
||||||
|
$(_this3.element).on(eventIn, _this3.config.selector, $.proxy(_this3._enter, _this3)).on(eventOut, _this3.config.selector, $.proxy(_this3._leave, _this3));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.config.selector) {
|
||||||
|
this.config = $.extend({}, this.config, {
|
||||||
|
trigger: 'manual',
|
||||||
|
selector: ''
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this._fixTitle();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Tooltip.prototype._fixTitle = function _fixTitle() {
|
||||||
|
var titleType = _typeof(this.element.getAttribute('data-original-title'));
|
||||||
|
if (this.element.getAttribute('title') || titleType !== 'string') {
|
||||||
|
this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
|
||||||
|
this.element.setAttribute('title', '');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Tooltip.prototype._enter = function _enter(event, context) {
|
||||||
|
var dataKey = this.constructor.DATA_KEY;
|
||||||
|
|
||||||
|
context = context || $(event.currentTarget).data(dataKey);
|
||||||
|
|
||||||
|
if (!context) {
|
||||||
|
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
||||||
|
$(event.currentTarget).data(dataKey, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event) {
|
||||||
|
context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($(context.getTipElement()).hasClass(ClassName.IN) || context._hoverState === HoverState.IN) {
|
||||||
context._hoverState = HoverState.IN;
|
context._hoverState = HoverState.IN;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!context.config.delay || !context.config.delay.show) {
|
clearTimeout(context._timeout);
|
||||||
|
|
||||||
|
context._hoverState = HoverState.IN;
|
||||||
|
|
||||||
|
if (!context.config.delay || !context.config.delay.show) {
|
||||||
|
context.show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
context._timeout = setTimeout(function () {
|
||||||
|
if (context._hoverState === HoverState.IN) {
|
||||||
context.show();
|
context.show();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
}, context.config.delay.show);
|
||||||
|
};
|
||||||
|
|
||||||
context._timeout = setTimeout(function () {
|
Tooltip.prototype._leave = function _leave(event, context) {
|
||||||
if (context._hoverState === HoverState.IN) {
|
var dataKey = this.constructor.DATA_KEY;
|
||||||
context.show();
|
|
||||||
}
|
context = context || $(event.currentTarget).data(dataKey);
|
||||||
}, context.config.delay.show);
|
|
||||||
|
if (!context) {
|
||||||
|
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
||||||
|
$(event.currentTarget).data(dataKey, context);
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
key: '_leave',
|
|
||||||
value: function _leave(event, context) {
|
|
||||||
var dataKey = this.constructor.DATA_KEY;
|
|
||||||
|
|
||||||
context = context || $(event.currentTarget).data(dataKey);
|
if (event) {
|
||||||
|
context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!context) {
|
if (context._isWithActiveTrigger()) {
|
||||||
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
return;
|
||||||
$(event.currentTarget).data(dataKey, context);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (event) {
|
clearTimeout(context._timeout);
|
||||||
context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (context._isWithActiveTrigger()) {
|
context._hoverState = HoverState.OUT;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
clearTimeout(context._timeout);
|
if (!context.config.delay || !context.config.delay.hide) {
|
||||||
|
context.hide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
context._hoverState = HoverState.OUT;
|
context._timeout = setTimeout(function () {
|
||||||
|
if (context._hoverState === HoverState.OUT) {
|
||||||
if (!context.config.delay || !context.config.delay.hide) {
|
|
||||||
context.hide();
|
context.hide();
|
||||||
|
}
|
||||||
|
}, context.config.delay.hide);
|
||||||
|
};
|
||||||
|
|
||||||
|
Tooltip.prototype._isWithActiveTrigger = function _isWithActiveTrigger() {
|
||||||
|
for (var trigger in this._activeTrigger) {
|
||||||
|
if (this._activeTrigger[trigger]) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
Tooltip.prototype._getConfig = function _getConfig(config) {
|
||||||
|
config = $.extend({}, this.constructor.Default, $(this.element).data(), config);
|
||||||
|
|
||||||
|
if (config.delay && typeof config.delay === 'number') {
|
||||||
|
config.delay = {
|
||||||
|
show: config.delay,
|
||||||
|
hide: config.delay
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||||
|
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
Tooltip.prototype._getDelegateConfig = function _getDelegateConfig() {
|
||||||
|
var config = {};
|
||||||
|
|
||||||
|
if (this.config) {
|
||||||
|
for (var key in this.config) {
|
||||||
|
if (this.constructor.Default[key] !== this.config[key]) {
|
||||||
|
config[key] = this.config[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
// static
|
||||||
|
|
||||||
|
Tooltip._jQueryInterface = function _jQueryInterface(config) {
|
||||||
|
return this.each(function () {
|
||||||
|
var data = $(this).data(DATA_KEY);
|
||||||
|
var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null;
|
||||||
|
|
||||||
|
if (!data && /destroy|hide/.test(config)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
context._timeout = setTimeout(function () {
|
if (!data) {
|
||||||
if (context._hoverState === HoverState.OUT) {
|
data = new Tooltip(this, _config);
|
||||||
context.hide();
|
$(this).data(DATA_KEY, data);
|
||||||
}
|
|
||||||
}, context.config.delay.hide);
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_isWithActiveTrigger',
|
|
||||||
value: function _isWithActiveTrigger() {
|
|
||||||
for (var trigger in this._activeTrigger) {
|
|
||||||
if (this._activeTrigger[trigger]) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
if (typeof config === 'string') {
|
||||||
}
|
if (data[config] === undefined) {
|
||||||
}, {
|
throw new Error('No method named "' + config + '"');
|
||||||
key: '_getConfig',
|
}
|
||||||
value: function _getConfig(config) {
|
data[config]();
|
||||||
config = $.extend({}, this.constructor.Default, $(this.element).data(), config);
|
|
||||||
|
|
||||||
if (config.delay && typeof config.delay === 'number') {
|
|
||||||
config.delay = {
|
|
||||||
show: config.delay,
|
|
||||||
hide: config.delay
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
_createClass(Tooltip, null, [{
|
||||||
|
|
||||||
return config;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: '_getDelegateConfig',
|
|
||||||
value: function _getDelegateConfig() {
|
|
||||||
var config = {};
|
|
||||||
|
|
||||||
if (this.config) {
|
|
||||||
for (var key in this.config) {
|
|
||||||
if (this.constructor.Default[key] !== this.config[key]) {
|
|
||||||
config[key] = this.config[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return config;
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
|
||||||
|
|
||||||
}], [{
|
|
||||||
key: '_jQueryInterface',
|
|
||||||
value: function _jQueryInterface(config) {
|
|
||||||
return this.each(function () {
|
|
||||||
var data = $(this).data(DATA_KEY);
|
|
||||||
var _config = typeof config === 'object' ? config : null;
|
|
||||||
|
|
||||||
if (!data && /destroy|hide/.test(config)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!data) {
|
|
||||||
data = new Tooltip(this, _config);
|
|
||||||
$(this).data(DATA_KEY, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
|
||||||
if (data[config] === undefined) {
|
|
||||||
throw new Error('No method named "' + config + '"');
|
|
||||||
}
|
|
||||||
data[config]();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: 'VERSION',
|
key: 'VERSION',
|
||||||
get: function get() {
|
get: function get() {
|
||||||
return VERSION;
|
return VERSION;
|
||||||
|
@ -605,7 +571,13 @@ var Tooltip = (function ($) {
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return Tooltip;
|
return Tooltip;
|
||||||
})();
|
}();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* jQuery
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
$.fn[NAME] = Tooltip._jQueryInterface;
|
$.fn[NAME] = Tooltip._jQueryInterface;
|
||||||
$.fn[NAME].Constructor = Tooltip;
|
$.fn[NAME].Constructor = Tooltip;
|
||||||
|
@ -615,5 +587,5 @@ var Tooltip = (function ($) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return Tooltip;
|
return Tooltip;
|
||||||
})(jQuery);
|
}(jQuery); /* global Tether */
|
||||||
//# sourceMappingURL=tooltip.js.map
|
//# sourceMappingURL=tooltip.js.map
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,9 +5,7 @@
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
var Util = function ($) {
|
||||||
|
|
||||||
var Util = (function ($) {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
@ -28,7 +26,7 @@ var Util = (function ($) {
|
||||||
|
|
||||||
// shoutout AngusCroll (https://goo.gl/pxwQGp)
|
// shoutout AngusCroll (https://goo.gl/pxwQGp)
|
||||||
function toType(obj) {
|
function toType(obj) {
|
||||||
return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
|
return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
function isElement(obj) {
|
function isElement(obj) {
|
||||||
|
@ -55,9 +53,9 @@ var Util = (function ($) {
|
||||||
|
|
||||||
var el = document.createElement('bootstrap');
|
var el = document.createElement('bootstrap');
|
||||||
|
|
||||||
for (var _name in TransitionEndEvent) {
|
for (var name in TransitionEndEvent) {
|
||||||
if (el.style[_name] !== undefined) {
|
if (el.style[name] !== undefined) {
|
||||||
return { end: TransitionEndEvent[_name] };
|
return { end: TransitionEndEvent[name] };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,12 +103,11 @@ var Util = (function ($) {
|
||||||
getUID: function getUID(prefix) {
|
getUID: function getUID(prefix) {
|
||||||
do {
|
do {
|
||||||
/* eslint-disable no-bitwise */
|
/* eslint-disable no-bitwise */
|
||||||
prefix += ~ ~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
|
prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
|
||||||
/* eslint-enable no-bitwise */
|
/* eslint-enable no-bitwise */
|
||||||
} while (document.getElementById(prefix));
|
} while (document.getElementById(prefix));
|
||||||
return prefix;
|
return prefix;
|
||||||
},
|
},
|
||||||
|
|
||||||
getSelectorFromElement: function getSelectorFromElement(element) {
|
getSelectorFromElement: function getSelectorFromElement(element) {
|
||||||
var selector = element.getAttribute('data-target');
|
var selector = element.getAttribute('data-target');
|
||||||
|
|
||||||
|
@ -121,25 +118,21 @@ var Util = (function ($) {
|
||||||
|
|
||||||
return selector;
|
return selector;
|
||||||
},
|
},
|
||||||
|
|
||||||
reflow: function reflow(element) {
|
reflow: function reflow(element) {
|
||||||
new Function('bs', 'return bs')(element.offsetHeight);
|
new Function('bs', 'return bs')(element.offsetHeight);
|
||||||
},
|
},
|
||||||
|
|
||||||
triggerTransitionEnd: function triggerTransitionEnd(element) {
|
triggerTransitionEnd: function triggerTransitionEnd(element) {
|
||||||
$(element).trigger(transition.end);
|
$(element).trigger(transition.end);
|
||||||
},
|
},
|
||||||
|
|
||||||
supportsTransitionEnd: function supportsTransitionEnd() {
|
supportsTransitionEnd: function supportsTransitionEnd() {
|
||||||
return Boolean(transition);
|
return Boolean(transition);
|
||||||
},
|
},
|
||||||
|
|
||||||
typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
|
typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
|
||||||
for (var property in configTypes) {
|
for (var property in configTypes) {
|
||||||
if (configTypes.hasOwnProperty(property)) {
|
if (configTypes.hasOwnProperty(property)) {
|
||||||
var expectedTypes = configTypes[property];
|
var expectedTypes = configTypes[property];
|
||||||
var value = config[property];
|
var value = config[property];
|
||||||
var valueType = undefined;
|
var valueType = void 0;
|
||||||
|
|
||||||
if (value && isElement(value)) {
|
if (value && isElement(value)) {
|
||||||
valueType = 'element';
|
valueType = 'element';
|
||||||
|
@ -158,5 +151,5 @@ var Util = (function ($) {
|
||||||
setTransitionEndSupport();
|
setTransitionEndSupport();
|
||||||
|
|
||||||
return Util;
|
return Util;
|
||||||
})(jQuery);
|
}(jQuery);
|
||||||
//# sourceMappingURL=util.js.map
|
//# sourceMappingURL=util.js.map
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue