Skip to content

Commit

Permalink
refactor(sliders): fix onload bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaSkywalker committed Mar 1, 2016
1 parent 3ca2ba9 commit 346a500
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 23 deletions.
24 changes: 8 additions & 16 deletions src/app/pages/ui/slider/slider.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ <h5>Basic</h5>
min="0"
max="100"
from="45"
disable="false"
timeout="350">
disable="false">
</ion-slider>
</div>
<div class="slider-box">
Expand All @@ -20,8 +19,7 @@ <h5>With prefix</h5>
max="1200"
prefix="$"
from="420"
disable="false"
timeout="350">
disable="false">
</ion-slider>
</div>
<div class="slider-box">
Expand All @@ -32,8 +30,7 @@ <h5>With postfix</h5>
max="90"
postfix="°"
from="36"
disable="false"
timeout="350">
disable="false">
</ion-slider>
</div>
<div class="slider-box">
Expand All @@ -44,8 +41,7 @@ <h5>Two way range</h5>
max="1200"
from="420"
to="900"
disable="false"
timeout="350">
disable="false">
</ion-slider>
</div>
<div class="slider-box">
Expand All @@ -56,8 +52,7 @@ <h5>With Steps</h5>
max="1000"
from="300"
step="50"
disable="false"
timeout="350">
disable="false">
</ion-slider>
</div>
<div class="slider-box">
Expand All @@ -70,8 +65,7 @@ <h5>Decorating numbers</h5>
step="1000"
prettify-separator="."
prettify="true"
disable="false"
timeout="350">
disable="false">
</ion-slider>
</div>
<div class="slider-box">
Expand All @@ -84,8 +78,7 @@ <h5>Using custom values array</h5>
'April', 'May', 'June',
'July', 'August', 'September',
'October', 'November', 'December']"
disable="false"
timeout="350">
disable="false">
</ion-slider>
</div>
<div class="slider-box">
Expand All @@ -95,8 +88,7 @@ <h5>Disabled</h5>
min="0"
max="100"
from="45"
disable="true"
timeout="350">
disable="true">
</ion-slider>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/theme/components/baPanel/baPanel.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
});
},
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 += '</div>';
return res;
Expand Down
5 changes: 0 additions & 5 deletions src/app/theme/directives/ionSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
timeout: '@'
},
link: function ($scope, $element) {
(function init() {
var timeout = $scope.timeout || 0;
$timeout(function(){
$element.ionRangeSlider({
min: $scope.min,
max: $scope.max,
Expand Down Expand Up @@ -87,8 +84,6 @@
$element.data("ionRangeSlider").update({disable: value});
});
});
}, timeout);
})();
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/theme/directives/zoomIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}

$timeout(function () {
elem.removeClass('invisible');
elem.removeClass('full-invisible');
elem.addClass('animated zoomIn');
}, delay);
}
Expand Down
7 changes: 7 additions & 0 deletions src/sass/theme/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,11 @@ a {
float: none;
display: inline-block;
}
}

.full-invisible {
visibility: hidden!important;
* {
visibility: hidden!important;
}
}

0 comments on commit 346a500

Please sign in to comment.