-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad281c9
commit a46f380
Showing
42 changed files
with
993 additions
and
614 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,50 @@ | ||
/*global require, angular*/ | ||
// 手风琴 | ||
(function () { | ||
"use strict"; | ||
require('./index.scss'); | ||
angular.module('jmui.accordion', []) | ||
.directive('jmAccordions', function () { | ||
return { | ||
restrict: 'AE', | ||
transclude: true, | ||
replace: true, | ||
template: '<div class="jm-accordions"><ul class="list-unstyled" ng-transclude></ul></div>', | ||
controller: function ($scope, $element, $attrs) { | ||
var accordions = this.$accordions = []; | ||
// $scope.open = '123' | ||
this.toggleAccrdion = function (accordion) { | ||
angular.forEach(accordions, function (item) { | ||
if (accordion !== item) { | ||
item.open = false; | ||
} | ||
}); | ||
}; | ||
|
||
angular.module('jmui.accordion', []) | ||
.directive('jmAccordions', function () { | ||
return { | ||
restrict: 'AE', | ||
transclude: true, | ||
replace: true, | ||
template: '<div class="jm-accordions"><ul class="list-unstyled" ng-transclude></ul></div>', | ||
controller: function ($scope, $element, $attrs) { | ||
var accordions = this.$accordions = []; | ||
// $scope.open = '123' | ||
this.toggleAccrdion = function (accordion) { | ||
angular.forEach(accordions, function (item) { | ||
if (accordion !== item) { | ||
item.open = false; | ||
} | ||
}); | ||
}; | ||
|
||
this.addAccordions = function (accordion) { | ||
accordions.push(accordion); | ||
}; | ||
}, | ||
link: function (scope, ele, attrs) {} | ||
}; | ||
}) | ||
.directive('jmAccordion', function () { | ||
return { | ||
restrict: 'AE', | ||
require: '^jmAccordions', | ||
template: '<li ng-class="{open: open}" class="jm-accordion" ><div ng-transclude></div></li>', | ||
transclude: true, | ||
replace: true, | ||
controller: function ($scope, $transclude) {}, | ||
this.addAccordions = function (accordion) { | ||
accordions.push(accordion); | ||
}; | ||
}, | ||
link: function (scope, ele, attrs) { | ||
} | ||
}; | ||
}) | ||
.directive('jmAccordion', function () { | ||
return { | ||
restrict: 'AE', | ||
require: '^jmAccordions', | ||
template: '<li ng-class="{open: open}" class="jm-accordion" ><div ng-transclude></div></li>', | ||
transclude: true, | ||
replace: true, | ||
controller: function ($scope, $transclude) { | ||
}, | ||
|
||
compile: function (tEl, tAttr, transclude) { | ||
return function postlink(scope, ele, attrs, ctrl) { | ||
scope.open = false; | ||
ctrl.addAccordions(scope); | ||
scope.toggle = function ($event) { | ||
scope.open = !scope.open; | ||
ctrl.toggleAccrdion(scope); | ||
}; | ||
compile: function (tEl, tAttr, transclude) { | ||
return function postlink(scope, ele, attrs, ctrl) { | ||
scope.open = false; | ||
ctrl.addAccordions(scope); | ||
scope.toggle = function ($event) { | ||
scope.open = !scope.open; | ||
ctrl.toggleAccrdion(scope); | ||
}; | ||
} | ||
}; | ||
}); | ||
}()); | ||
}; | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* 手风琴*/ | ||
.jm-accordions { | ||
border:1px solid #c9c9c9; | ||
} | ||
|
||
.jm-accordions .jm-accordion { | ||
background: #fff; | ||
|
||
.jm-accordion-title{ | ||
position: relative; | ||
padding-left: 30px; | ||
} | ||
|
||
.jm-icon-enter{ | ||
position: absolute; | ||
left: 10px; | ||
transition: all .3s linear; | ||
} | ||
} | ||
|
||
.jm-accordions .jm-accordion + .jm-accordion { | ||
border-top:1px solid #c9c9c9; | ||
} | ||
|
||
.jm-accordions .jm-accordion-title { | ||
cursor: default; | ||
padding: 20px 30px; | ||
} | ||
|
||
.jm-accordions .jm-accordion-content { | ||
// display: none; | ||
overflow: hidden; | ||
border-top:1px solid #c9c9c9; | ||
} | ||
|
||
.jm-accordions .jm-accordion-content p { | ||
padding: 20px; | ||
} | ||
|
||
.jm-accordions .jm-accordion.open { | ||
.jm-icon-enter{ | ||
transform: rotate(90deg); | ||
} | ||
} | ||
|
||
.jm-accordions .jm-accordion.open .jm-accordion-content { | ||
} | ||
|
||
.jm-accordions.jm-accordions-vertical { | ||
width: 800px; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
.jm-accordion-content{ transition:all linear .3s; opacity:1; height: 200px; } | ||
.jm-accordion-content.ng-hide{ opacity:0;} | ||
.jm-accordion-content.ng-hide { } | ||
.jm-accordion-content.ng-hide-add { opacity:1; height: 200px; display: block;} | ||
.jm-accordion-content.ng-hide-add.ng-hide-add-active { opacity:0; height: 0; } | ||
.jm-accordion-content.ng-hide-remove { opacity:0; height: 0; display: block;} | ||
.jm-accordion-content.ng-hide-remove.ng-hide-remove-active {opacity:1; height: 200px; } |
Oops, something went wrong.