Added delete button to restore default

Signed-off-by: fnuesse <felix.nuesse@t-online.de>
This commit is contained in:
fnuesse 2018-12-30 14:12:44 +01:00
parent 1a06b5cd9b
commit c86e4f87b5
No known key found for this signature in database
GPG key ID: 2089A3431243E819
3 changed files with 11 additions and 0 deletions

View file

@ -143,6 +143,7 @@ class TranslationController extends ApiController {
'pick.icon.search' => $this->trans->t('Search icons'),
'pick.icon.custom.label' => $this->trans->t('Upload a custom icon:'),
'use.icon' => $this->trans->t('Use this icon'),
'use.icon.delete' => $this->trans->t('Delete current icon'),
'selected.icon' => $this->trans->t('Selected icon'),
// templates/views/partials/edit_credential/custom_fields.html

View file

@ -108,6 +108,13 @@
fr.readAsDataURL(f);
});
scope.deleteIcon = function() {
delete scope.credential.icon.type;
delete scope.credential.icon.content;
delete scope.credential.icon;
$('#iconPicker').dialog('close');
};
scope.useIcon = function() {
if(scope.customIcon){

View file

@ -31,6 +31,9 @@
<br />
<button ng-click="useIcon()">{{ 'use.icon' | translate}}</button>
</div>
<div ng-if="credential.icon">
<button ng-click="deleteIcon()">{{ 'use.icon.delete' | translate}}</button>
</div>
</div>
</div>