Automatically scroll plugins into view
This commit is contained in:
parent
1354ccd470
commit
e48fe29cf8
2 changed files with 10 additions and 1 deletions
|
@ -4,7 +4,7 @@
|
||||||
Hide {{ plugin.name }}
|
Hide {{ plugin.name }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div ng-bind-html="displayedContent"></div>
|
<div ng-bind-html="displayedContent" bo-class="plugin.$$hashKey"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-hide="plugin.visible">
|
<div ng-hide="plugin.visible">
|
||||||
|
|
|
@ -810,6 +810,15 @@ weechat.directive('plugin', function() {
|
||||||
*/
|
*/
|
||||||
$scope.displayedContent = $scope.plugin.content;
|
$scope.displayedContent = $scope.plugin.content;
|
||||||
$scope.plugin.visible = true;
|
$scope.plugin.visible = true;
|
||||||
|
|
||||||
|
// Scroll embed content into view
|
||||||
|
var elems = $("." + $scope.plugin.$$hashKey);
|
||||||
|
if (elems.length == 1) {
|
||||||
|
var scroll = function() {
|
||||||
|
elems[0].scrollIntoViewIfNeeded();
|
||||||
|
};
|
||||||
|
setTimeout(scroll, 100);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue