-
Notifications
You must be signed in to change notification settings - Fork 21
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
Showing
10 changed files
with
89 additions
and
67 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
52 changes: 52 additions & 0 deletions
52
scenarioo-client/app/scripts/directives/collapsablePanel.js
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,52 @@ | ||
/* scenarioo-client | ||
* Copyright (C) 2014, scenarioo.org Development Team | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
angular.module('scenarioo.directives').directive('scCollapsablePanel', function() { | ||
return { | ||
restrict: 'E', | ||
transclude: true, | ||
templateUrl: 'views/collapsablePanel.html', | ||
scope: { title: "@", key: "@" }, | ||
link: function (scope, element, attributes ) { | ||
|
||
}, | ||
controller: function($scope, localStorageService) { | ||
var MAIN_METADATA_SECTION_EXPANDED = 'scenarioo-panelExpanded-'; | ||
|
||
$scope.isMetadataExpanded = function (type) { | ||
var metadataExpanded = localStorageService.get(MAIN_METADATA_SECTION_EXPANDED + type); | ||
if (metadataExpanded === 'true') { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
}; | ||
|
||
$scope.toggleMetadataExpanded = function (type) { | ||
var metadataExpanded = !$scope.isMetadataExpanded(type); | ||
localStorageService.set(MAIN_METADATA_SECTION_EXPANDED + type, '' + metadataExpanded); | ||
}; | ||
|
||
$scope.isMetadataCollapsed = function (type) { | ||
return !$scope.isMetadataExpanded(type); | ||
}; | ||
|
||
} | ||
}; | ||
}); |
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 |
---|---|---|
|
@@ -25,5 +25,4 @@ angular.module('scenarioo.directives').directive('scMetadataTree', function() { | |
metadataTree: '=' | ||
} | ||
}; | ||
|
||
}); |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading link" ng-click="toggleMetadataExpanded(key)"> | ||
<h3 class="panel-title">{{title}}</h3> | ||
</div> | ||
<div class="panel-body" ng-class="{hidden: isMetadataCollapsed(key), metadata: true}"> | ||
<div ng-transclude></div> | ||
</div> | ||
</div> | ||
</div> |
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,10 +1,5 @@ | ||
<div ng-repeat="(key,value) in metadataTree"> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading link" ng-click="toggleMetadataExpanded(key)"> | ||
<h3 class="panel-title">{{key}}</h3> | ||
</div> | ||
<div class="panel-body" ng-class="{hidden: isMetadataCollapsed(key), metadata: true}"> | ||
<sc-tree data='value'></sc-tree> | ||
</div> | ||
</div> | ||
<sc-collapsable-panel title="{{key}}" key="{{key}}"> | ||
<sc-tree data='value'></sc-tree> | ||
</sc-collapsable-panel> | ||
</div> |
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