Make reset show the original icon

This commit is contained in:
Girish Ramakrishnan
2019-05-21 00:14:44 -07:00
parent f0093c5e4f
commit 7b2ae2c457
2 changed files with 8 additions and 3 deletions
+2 -2
View File
@@ -111,9 +111,9 @@
</div>
<div class="form-group">
<label class="control-label">Icon</label>
<a href="" class="pull-right" style="font-weight: normal;" ng-click="appConfigure.icon.data = ''">Reset</a>
<a href="" class="pull-right" style="font-weight: normal;" ng-click="appConfigure.resetCustomIcon()">Reset</a>
<div>
<img id="previewIcon" width="128" height="128" ng-src="{{appConfigure.icon.data || appConfigure.app.iconUrl}}" ng-click="appConfigure.showCustomIconSelector()"/>
<img id="previewIcon" width="128" height="128" ng-src="{{appConfigure.icon.data || appConfigure.icon.url || appConfigure.app.iconUrl}}" ng-click="appConfigure.showCustomIconSelector()"/>
<input type="file" id="iconFileInput" style="display: none" accept="image/png"/>
</div>
</div>
+6 -1
View File
@@ -50,7 +50,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
ssoAuth: false,
tags: '',
label: '',
icon: { data: null },
icon: { file: null, data: null, url: null },
action: 'general',
@@ -254,6 +254,11 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
});
},
resetCustomIcon: function () {
$scope.appConfigure.icon.data = '';
$scope.appConfigure.icon.url = $scope.appConfigure.app.iconUrl + '&original=true';
},
showCustomIconSelector: function () {
$('#iconFileInput').click();
}