1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-11-17 10:45:41 +01:00

stop click directive instead of inline js

This commit is contained in:
Kyle Spearrin 2017-06-09 15:14:36 -04:00
parent d6f1a55d30
commit 5409ba7737
5 changed files with 16 additions and 4 deletions

View File

@ -8,7 +8,7 @@
<div ng-if="logins.length">
<div class="list">
<div class="list-grouped">
<a href="javascript:void(0)" ng-click="fillLogin(login)" class="list-grouped-item condensed"
<a href="#" stop-click ng-click="fillLogin(login)" class="list-grouped-item condensed"
title="{{i18n.autoFill}} {{login.name}}"
ng-repeat="login in theLogins = (logins | orderBy: [sortUriMatch, 'name', 'username']) track by $index">
<span class="btn-list" href="" ng-click="$event.stopPropagation()" title="{{i18n.copyPassword}}"

View File

@ -0,0 +1,11 @@
angular
.module('bit.directives')
// ref: https://stackoverflow.com/a/14165848/1090359
.directive('stopClick', function () {
return function (scope, element, attrs) {
$(element).click(function (event) {
event.preventDefault();
});
};
});

View File

@ -18,7 +18,7 @@
{{i18n.folders}}
<span>{{vaultFolders.length}}</span>
</div>
<a href="javascript:void(0)" ng-click="viewFolder(folder)" class="list-section-item"
<a href="#" stop-click ng-click="viewFolder(folder)" class="list-section-item"
ng-repeat="folder in vaultFolders | orderBy: folderSort track by $index">
{{folder.name}}
<i class="fa fa-chevron-right fa-lg"></i>
@ -35,7 +35,7 @@
<small>{{vaultFolderLogins.length}}</small>
<i class="fa fa-folder-open"></i> {{folder.name}}
</div>
<a href="javascript:void(0)" ng-click="viewLogin(login)"
<a href="#" stop-click ng-click="viewLogin(login)"
class="list-grouped-item condensed" title="{{i18n.edit}} {{login.name}}"
ng-repeat="login in vaultFolderLogins = (vaultLogins | filter: { folderId: folder.id }
| filter: searchLogins() | orderBy: ['name', 'username']) track by $index">

View File

@ -19,7 +19,7 @@
{{folder.name}}
<span>{{vaultLogins.length}}</span>
</div>
<a href="javascript:void(0)" ng-click="viewLogin(login)"
<a href="#" stop-click ng-click="viewLogin(login)"
class="list-section-item condensed" title="{{i18n.edit}} {{login.name}}"
ng-repeat="login in pagedVaultLogins track by $index">
<span class="btn-list" ng-click="$event.stopPropagation()" title="{{i18n.copyPassword}}" ngclipboard

View File

@ -40,6 +40,7 @@
<script src="app/directives/directivesModule.js"></script>
<script src="app/directives/formDirective.js"></script>
<script src="app/directives/stopClickDirective.js"></script>
<script src="app/services/servicesModule.js"></script>
<script src="app/services/backgroundService.js"></script>