Skip to content

Commit

Permalink
Use event.currentTarget instead of this. Fixes #471
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Mar 19, 2018
1 parent 0cd066f commit 2f6276d
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions src/app/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -966,13 +966,13 @@ dwv.App = function ()
};

/**
* Handle loader change.
* Handle loader change. Will activate the loader using
* the value property of the 'event.currentTarget'.
* @param {Object} event The change event.
*/
this.onChangeLoader = function (/*event*/)
this.onChangeLoader = function (event)
{
// called from an HTML select, use its value
loadbox.displayLoader( this.value );
loadbox.displayLoader( event.currentTarget.value );
};

/**
Expand Down Expand Up @@ -1027,53 +1027,53 @@ dwv.App = function ()
};

/**
* Handle colour map change.
* Handle colour map change. Will activate the tool using
* the value property of the 'event.currentTarget'.
* @param {Object} event The change event.
*/
this.onChangeColourMap = function (/*event*/)
this.onChangeColourMap = function (event)
{
// called from an HTML select, use its value
viewController.setColourMapFromName(this.value);
viewController.setColourMapFromName( event.currentTarget.value );
};

/**
* Handle window/level preset change.
* Handle window/level preset change. Will activate the preset using
* the value property of the 'event.currentTarget'.
* @param {Object} event The change event.
*/
this.onChangeWindowLevelPreset = function (/*event*/)
this.onChangeWindowLevelPreset = function (event)
{
// value should be the name of the preset
viewController.setWindowLevelPreset( this.value );
viewController.setWindowLevelPreset( event.currentTarget.value );
};

/**
* Handle tool change.
* Handle tool change. Will activate the tool using
* the value property of the 'event.currentTarget'.
* @param {Object} event The change event.
*/
this.onChangeTool = function (/*event*/)
this.onChangeTool = function (event)
{
// called from an HTML select, use its value
toolboxController.setSelectedTool(this.value);
toolboxController.setSelectedTool( event.currentTarget.value );
};

/**
* Handle shape change.
* Handle shape change. Will activate the shape using
* the value property of the 'event.currentTarget'.
* @param {Object} event The change event.
*/
this.onChangeShape = function (/*event*/)
this.onChangeShape = function (event)
{
// called from an HTML select, use its value
toolboxController.setSelectedShape(this.value);
toolboxController.setSelectedShape( event.currentTarget.value );
};

/**
* Handle filter change.
* Handle filter change. Will activate the filter using
* the value property of the 'event.currentTarget'.
* @param {Object} event The change event.
*/
this.onChangeFilter = function (/*event*/)
this.onChangeFilter = function (event)
{
// called from an HTML select, use its value
toolboxController.setSelectedFilter(this.value);
toolboxController.setSelectedFilter( event.currentTarget.value );
};

/**
Expand All @@ -1086,13 +1086,14 @@ dwv.App = function ()
};

/**
* Handle line colour change.
* Handle line colour change. Will activate the colour using
* the value property of the 'event.currentTarget'.
* @param {Object} event The change event.
*/
this.onChangeLineColour = function (/*event*/)
this.onChangeLineColour = function (event)
{
// called from an HTML select, use its value
toolboxController.setLineColour(this.value);
toolboxController.setLineColour( event.currentTarget.value );
};

/**
Expand Down

0 comments on commit 2f6276d

Please sign in to comment.