1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 10:16:26 +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>
<div class="result-block row-fluid"> <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> <li ng-click="selectSnippet($index)" ng-repeat="snippet in filteredSnippets" ng-class="{active:$index == selectIndex}"><a href="#">{{snippet.description}}</a></li>
</ul> </ul>

View File

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

View File

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