stop prop and clicks from vault list

This commit is contained in:
Kyle Spearrin 2017-06-12 09:49:31 -04:00
parent 2d13d18c69
commit 12c3b7e85b
6 changed files with 19 additions and 10 deletions

View File

@ -96,9 +96,7 @@ angular
}
};
$scope.viewLogin = function (login, e) {
e.stopPropagation();
$scope.viewLogin = function (login) {
$state.go('viewLogin', {
loginId: login.id,
animation: 'in-slide-up',

View File

@ -11,19 +11,19 @@
<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}}"
<span class="btn-list" stop-prop stop-click title="{{i18n.copyPassword}}"
ngclipboard ngclipboard-error="clipboardError(e)"
ngclipboard-success="clipboardSuccess(e, i18n.password)"
data-clipboard-text="{{login.password}}" ng-class="{'disabled': !login.password}">
<i class="fa fa-lg fa-key"></i>
</span>
<span class="btn-list" href="" ng-click="$event.stopPropagation()" title="{{i18n.copyUsername}}"
<span class="btn-list" stop-prop stop-click title="{{i18n.copyUsername}}"
ngclipboard ngclipboard-error="clipboardError(e)"
ngclipboard-success="clipboardSuccess(e, i18n.username)"
data-clipboard-text="{{login.username}}" ng-class="{'disabled': !login.username}">
<i class="fa fa-lg fa-user"></i>
</span>
<span class="btn-list" href="" ng-click="viewLogin(login, $event) && $event.stopPropagation()"
<span class="btn-list" ng-click="viewLogin(login)" stop-prop stop-click
title="{{i18n.edit}} {{login.name}}">
<i class="fa fa-lg fa-pencil"></i>
</span>

View File

@ -0,0 +1,10 @@
angular
.module('bit.directives')
.directive('stopProp', function () {
return function (scope, element, attrs) {
$(element).click(function (event) {
event.stopPropagation();
});
};
});

View File

@ -39,12 +39,12 @@
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">
<span class="btn-list" ng-click="$event.stopPropagation()" title="{{i18n.copyPassword}}" ngclipboard
<span class="btn-list" stop-prop stop-click title="{{i18n.copyPassword}}" ngclipboard
ngclipboard-error="clipboardError(e)" ngclipboard-success="clipboardSuccess(e, i18n.password)"
data-clipboard-text="{{login.password}}" ng-class="{'disabled': !login.password}">
<i class="fa fa-lg fa-key"></i>
</span>
<span class="btn-list" ng-click="$event.stopPropagation()" title="{{i18n.copyUsername}}" ngclipboard
<span class="btn-list" stop-prop stop-click title="{{i18n.copyUsername}}" ngclipboard
ngclipboard-error="clipboardError(e)" ngclipboard-success="clipboardSuccess(e, i18n.username)"
data-clipboard-text="{{login.username}}" ng-class="{'disabled': !login.username}">
<i class="fa fa-lg fa-user"></i>

View File

@ -22,12 +22,12 @@
<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
<span class="btn-list" stop-prop stop-click title="{{i18n.copyPassword}}" ngclipboard
ngclipboard-error="clipboardError(e)" ngclipboard-success="clipboardSuccess(e, i18n.password)"
data-clipboard-text="{{login.password}}" ng-class="{'disabled': !login.password}">
<i class="fa fa-lg fa-key"></i>
</span>
<span class="btn-list" ng-click="$event.stopPropagation()" title="{{i18n.copyUsername}}" ngclipboard
<span class="btn-list" stop-prop stop-click title="{{i18n.copyUsername}}" ngclipboard
ngclipboard-error="clipboardError(e)" ngclipboard-success="clipboardSuccess(e, i18n.username)"
data-clipboard-text="{{login.username}}" ng-class="{'disabled': !login.username}">
<i class="fa fa-lg fa-user"></i>

View File

@ -41,6 +41,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/directives/stopPropDirective.js"></script>
<script src="app/services/servicesModule.js"></script>
<script src="app/services/backgroundService.js"></script>