Skip to content

Commit 915cfbe

Browse files
added animate function
1 parent 2096cd5 commit 915cfbe

File tree

6 files changed

+434
-172
lines changed

6 files changed

+434
-172
lines changed

.idea/workspace.xml

Lines changed: 133 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/scripts/app.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
open: false,
3333
disabled: false,
3434
beforeOpen: noopPromise,
35-
beforeHide: noopPromise
35+
beforeHide: noopPromise,
36+
animateOpen:angular.noop,
37+
animateClose:angular.noop
3638
}
3739
}
3840

@@ -46,15 +48,23 @@
4648
AccordionGroup.prototype.show = function (animationFn) {
4749
var _self = this;
4850
getService('$q').when(_self.options.beforeOpen()).then(function () {
49-
_self.body[animationFn]('slow');//slideDown
51+
if(_self.options.animateOpen==angular.noop){
52+
_self.body[animationFn]('slow');//slideDown
53+
}else{
54+
_self.options.animateOpen.call(_self);
55+
}
5056
}, function (error) {
5157
getService('$log').error(error);
5258
})
5359
};
5460
AccordionGroup.prototype.hide = function (animationFn) {
5561
var _self = this;
5662
getService('$q').when(_self.options.beforeHide()).then(function () {
57-
_self.body[animationFn]();//slideUp
63+
if(_self.options.animateClose==angular.noop){
64+
_self.body[animationFn]();//slideUp
65+
}else{
66+
_self.options.animateClose.call(_self);
67+
}
5868
}, function (error) {
5969
getService('$log').error(error);
6070
})

dist/scripts/ui-accordion.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
open: false,
3333
disabled: false,
3434
beforeOpen: noopPromise,
35-
beforeHide: noopPromise
35+
beforeHide: noopPromise,
36+
animateOpen:angular.noop,
37+
animateClose:angular.noop
3638
}
3739
}
3840

@@ -46,15 +48,23 @@
4648
AccordionGroup.prototype.show = function (animationFn) {
4749
var _self = this;
4850
getService('$q').when(_self.options.beforeOpen()).then(function () {
49-
_self.body[animationFn]('slow');//slideDown
51+
if(_self.options.animateOpen==angular.noop){
52+
_self.body[animationFn]('slow');//slideDown
53+
}else{
54+
_self.options.animateOpen.call(_self);
55+
}
5056
}, function (error) {
5157
getService('$log').error(error);
5258
})
5359
};
5460
AccordionGroup.prototype.hide = function (animationFn) {
5561
var _self = this;
5662
getService('$q').when(_self.options.beforeHide()).then(function () {
57-
_self.body[animationFn]();//slideUp
63+
if(_self.options.animateClose==angular.noop){
64+
_self.body[animationFn]();//slideUp
65+
}else{
66+
_self.options.animateClose.call(_self);
67+
}
5868
}, function (error) {
5969
getService('$log').error(error);
6070
})

dist/scripts/ui-accordion.min.js

Lines changed: 1 addition & 110 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)