refactor(sliders): fix onload bug

pull/3/head
alex 9 years ago
parent 3ca2ba9bb1
commit 346a500765

@ -8,8 +8,7 @@
min="0" min="0"
max="100" max="100"
from="45" from="45"
disable="false" disable="false">
timeout="350">
</ion-slider> </ion-slider>
</div> </div>
<div class="slider-box"> <div class="slider-box">
@ -20,8 +19,7 @@
max="1200" max="1200"
prefix="$" prefix="$"
from="420" from="420"
disable="false" disable="false">
timeout="350">
</ion-slider> </ion-slider>
</div> </div>
<div class="slider-box"> <div class="slider-box">
@ -32,8 +30,7 @@
max="90" max="90"
postfix="°" postfix="°"
from="36" from="36"
disable="false" disable="false">
timeout="350">
</ion-slider> </ion-slider>
</div> </div>
<div class="slider-box"> <div class="slider-box">
@ -44,8 +41,7 @@
max="1200" max="1200"
from="420" from="420"
to="900" to="900"
disable="false" disable="false">
timeout="350">
</ion-slider> </ion-slider>
</div> </div>
<div class="slider-box"> <div class="slider-box">
@ -56,8 +52,7 @@
max="1000" max="1000"
from="300" from="300"
step="50" step="50"
disable="false" disable="false">
timeout="350">
</ion-slider> </ion-slider>
</div> </div>
<div class="slider-box"> <div class="slider-box">
@ -70,8 +65,7 @@
step="1000" step="1000"
prettify-separator="." prettify-separator="."
prettify="true" prettify="true"
disable="false" disable="false">
timeout="350">
</ion-slider> </ion-slider>
</div> </div>
<div class="slider-box"> <div class="slider-box">
@ -84,8 +78,7 @@
'April', 'May', 'June', 'April', 'May', 'June',
'July', 'August', 'September', 'July', 'August', 'September',
'October', 'November', 'December']" 'October', 'November', 'December']"
disable="false" disable="false">
timeout="350">
</ion-slider> </ion-slider>
</div> </div>
<div class="slider-box"> <div class="slider-box">
@ -95,8 +88,7 @@
min="0" min="0"
max="100" max="100"
from="45" from="45"
disable="true" disable="true">
timeout="350">
</ion-slider> </ion-slider>
</div> </div>
</div> </div>

@ -21,7 +21,7 @@
}); });
}, },
template: function(el, attrs) { template: function(el, attrs) {
var res = '<div class="panel {{panelType}} invisible ' + (attrs.baPanelClass || '') + '" zoom-in ba-panel-blur>'; var res = '<div class="panel {{panelType}} full-invisible ' + (attrs.baPanelClass || '') + '" zoom-in ba-panel-blur>';
res += baPanel.template(el, attrs); res += baPanel.template(el, attrs);
res += '</div>'; res += '</div>';
return res; return res;

@ -37,9 +37,6 @@
timeout: '@' timeout: '@'
}, },
link: function ($scope, $element) { link: function ($scope, $element) {
(function init() {
var timeout = $scope.timeout || 0;
$timeout(function(){
$element.ionRangeSlider({ $element.ionRangeSlider({
min: $scope.min, min: $scope.min,
max: $scope.max, max: $scope.max,
@ -87,8 +84,6 @@
$element.data("ionRangeSlider").update({disable: value}); $element.data("ionRangeSlider").update({disable: value});
}); });
}); });
}, timeout);
})();
} }
}; };
} }

@ -19,7 +19,7 @@
} }
$timeout(function () { $timeout(function () {
elem.removeClass('invisible'); elem.removeClass('full-invisible');
elem.addClass('animated zoomIn'); elem.addClass('animated zoomIn');
}, delay); }, delay);
} }

@ -176,3 +176,10 @@ a {
display: inline-block; display: inline-block;
} }
} }
.full-invisible {
visibility: hidden!important;
* {
visibility: hidden!important;
}
}
Loading…
Cancel
Save