mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Fixed #360 - dynamic slidebox sizing
This commit is contained in:
35
dist/js/ionic-angular.js
vendored
35
dist/js/ionic-angular.js
vendored
@@ -29,6 +29,7 @@ angular.module('ionic.service', [
|
||||
// UI specific services and delegates
|
||||
angular.module('ionic.ui.service', [
|
||||
'ionic.ui.service.scrollDelegate',
|
||||
'ionic.ui.service.slideBoxDelegate',
|
||||
]);
|
||||
|
||||
angular.module('ionic.ui', [
|
||||
@@ -121,6 +122,36 @@ angular.module('ionic.ui.service.scrollDelegate', [])
|
||||
};
|
||||
}]);
|
||||
|
||||
})(ionic);
|
||||
;
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
angular.module('ionic.ui.service.slideBoxDelegate', [])
|
||||
|
||||
.factory('SlideBoxDelegate', ['$rootScope', '$timeout', function($rootScope, $timeout) {
|
||||
return {
|
||||
/**
|
||||
* Trigger a slidebox to update and resize itself
|
||||
*/
|
||||
update: function(animate) {
|
||||
$rootScope.$broadcast('slideBox.update');
|
||||
},
|
||||
|
||||
register: function($scope, $element) {
|
||||
$scope.$parent.$on('slideBox.update', function(e) {
|
||||
if(e.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
$timeout(function() {
|
||||
$scope.$parent.slideBox.setup();
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
};
|
||||
}]);
|
||||
|
||||
})(ionic);
|
||||
;
|
||||
angular.module('ionic.service.actionSheet', ['ionic.service.templateLoad', 'ionic.ui.actionSheet', 'ngAnimate'])
|
||||
@@ -2317,7 +2348,7 @@ angular.module('ionic.ui.slideBox', [])
|
||||
* The internal controller for the slide box controller.
|
||||
*/
|
||||
|
||||
.directive('slideBox', ['$timeout', '$compile', function($timeout, $compile) {
|
||||
.directive('slideBox', ['$timeout', '$compile', 'SlideBoxDelegate', function($timeout, $compile, SlideBoxDelegate) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
@@ -2377,6 +2408,8 @@ angular.module('ionic.ui.slideBox', [])
|
||||
|
||||
$scope.$parent.slideBox = slider;
|
||||
|
||||
SlideBoxDelegate.register($scope, $element);
|
||||
|
||||
this.getNumSlides = function() {
|
||||
return slider.getNumSlides();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user