1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

inhance popup navigating & set popup on all wspc

This commit is contained in:
Rokt33r
2015-06-14 17:15:13 +09:00
parent 9e635715c5
commit 87c9e3e03b
3 changed files with 17 additions and 1 deletions

View File

@@ -20,7 +20,7 @@
</div>
<div class="result-block row-fluid">
<ul class="result-list left-pane" ng-class="{focused:isFocusing == 2}">
<ul id="result-list" class="result-list left-pane" ng-class="{focused:isFocusing == 2}">
<li ng-click="selectSnippet($index)" ng-repeat="snippet in filteredSnippets" ng-class="{active:$index == selectIndex}"><a href="#">{{snippet.description}}</a></li>
</ul>

View File

@@ -3,6 +3,8 @@
var remote = require('remote')
var ipc = require('ipc')
var resultList = document.getElementById('result-list')
angular.module('codexen.popup', [
'ui.ace',
'satellizer',
@@ -31,8 +33,10 @@ angular.module('codexen.popup', [
e.preventDefault()
})
.add('right', function (e) {
e.preventDefault()
})
.add('left', function (e) {
e.preventDefault()
})
.add('esc', function (e) {
hidePopUp()
@@ -41,6 +45,7 @@ angular.module('codexen.popup', [
e.preventDefault()
})
.add('tab', function (e) {
e.preventDefault()
})
.add('enter', function (e) {
console.log($scope.selectedItem.content)
@@ -118,6 +123,11 @@ angular.module('codexen.popup', [
function priorSnippet () {
if ($scope.selectIndex > 0) $scope.selectIndex -= 1
if (resultList.children[$scope.selectIndex].offsetTop < resultList.scrollTop) {
resultList.scrollTop -= 33
}
selectSnippet()
}
@@ -125,6 +135,11 @@ angular.module('codexen.popup', [
if ($scope.selectIndex < $scope.filteredSnippets.length - 1) {
$scope.selectIndex += 1
}
if (resultList.clientHeight - 33 < resultList.children[$scope.selectIndex].offsetTop - resultList.scrollTop) {
resultList.scrollTop += 33
}
selectSnippet()
}

View File

@@ -53,6 +53,7 @@ app.on('ready', function () {
popUpWindow.on('blur', function () {
popUpWindow.hide()
})
popUpWindow.setVisibleOnAllWorkspaces(true)
var hidePopUp = function () {
if (fromMain) {