Add button to burn the same image again. Fixes #74

This commit is contained in:
Federico Martín Alconada Verzini
2016-01-18 15:21:29 -03:00
committed by Juan Cruz Viotti
parent 1f3baf3f4d
commit 6331ee4aa1
5 changed files with 67 additions and 15 deletions

View File

@@ -18,6 +18,7 @@
* @module ResinEtcher.selection-state
*/
var _ = require('lodash');
var angular = require('angular');
var selectionState = angular.module('ResinEtcher.selection-state', []);
@@ -148,15 +149,25 @@ selectionState.service('SelectionStateService', function() {
};
/**
* @summary Clear all selections
* @summary Clear selections
* @function
* @public
*
* @param {Object} options - options
* @param {Boolean} [options.preserveImage] - preserve image
*
* @example
* SelectionStateService.clear();
*
* @example
* SelectionStateService.clear({ preserveImage: true });
*/
this.clear = function() {
selection = {};
this.clear = function(options) {
if (options && options.preserveImage) {
selection = _.pick(selection, 'image');
} else {
selection = {};
}
};
});