mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
action buttons component
This commit is contained in:
@@ -1,18 +1,41 @@
|
||||
angular
|
||||
.module('bit.components')
|
||||
|
||||
.component('actionButtonsComponent', {
|
||||
.component('actionButtons', {
|
||||
bindings: {
|
||||
uri: '<'
|
||||
cipher: '<',
|
||||
showView: '<',
|
||||
onView: '&'
|
||||
},
|
||||
template: '',
|
||||
controller: function (stateService) {
|
||||
this.$onInit = (function () {
|
||||
|
||||
}).bind(this);
|
||||
templateUrl: 'app/components/views/actionButtons.html',
|
||||
controller: function (i18nService, $analytics, constantsService, toastr, $timeout, $window, utilsService) {
|
||||
var ctrl = this;
|
||||
|
||||
this.$onChanges = (function () {
|
||||
|
||||
}).bind(this);
|
||||
ctrl.$onInit = function () {
|
||||
ctrl.i18n = i18nService;
|
||||
ctrl.constants = constantsService;
|
||||
|
||||
ctrl.launch = function () {
|
||||
$timeout(function () {
|
||||
if (ctrl.cipher.login.uri.startsWith('http://') || ctrl.cipher.login.uri.startsWith('https://')) {
|
||||
$analytics.eventTrack('Launched Website From Listing');
|
||||
chrome.tabs.create({ url: ctrl.cipher.login.uri });
|
||||
if (utilsService.inPopup($window)) {
|
||||
$window.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ctrl.clipboardError = function (e) {
|
||||
toastr.info(i18n.browserNotSupportClipboard);
|
||||
};
|
||||
|
||||
ctrl.clipboardSuccess = function (e, type, aType) {
|
||||
e.clearSelection();
|
||||
$analytics.eventTrack('Copied ' + aType);
|
||||
toastr.info(type + i18nService.valueCopied);
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user