Only retrieve plugin content when 'Show Content' is pressed
This commit is contained in:
parent
6b12926887
commit
f4ee683100
2 changed files with 37 additions and 11 deletions
|
@ -764,13 +764,38 @@ weechat.config(['$routeProvider',
|
|||
|
||||
|
||||
weechat.directive('plugin', function() {
|
||||
|
||||
/*
|
||||
* Plugin directive
|
||||
* Shows additional plugin content
|
||||
*/
|
||||
return {
|
||||
templateUrl: 'directives/plugin.html',
|
||||
|
||||
scope: {
|
||||
data: '=data',
|
||||
plugin: '=data',
|
||||
},
|
||||
|
||||
controller: function($scope) {
|
||||
|
||||
$scope.displayedContent = "";
|
||||
|
||||
$scope.hideContent = function() {
|
||||
$scope.plugin.visible = false;
|
||||
}
|
||||
|
||||
$scope.showContent = function() {
|
||||
/*
|
||||
* Shows the plugin content.
|
||||
* displayedContent is bound to the DOM.
|
||||
* Actual plugin content is only fetched when
|
||||
* content is shown.
|
||||
*/
|
||||
$scope.displayedContent = $scope.plugin.content;
|
||||
$scope.plugin.visible = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue