Skip to content

Commit

Permalink
Fix slider not sending if mouse leaves widget in "on release" mode
Browse files Browse the repository at this point in the history
Bump for 2.16.1 release
  • Loading branch information
Dave Conway-Jones committed Aug 22, 2019
1 parent 64ae7ee commit a2b9286
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
### 2.16.1-beta: Maintenance Release
### 2.16.1: Maintenance Release

**Fixes**

- Fix toast to show border correctly and better timing. Issue #525
- Stop colour picker sending on page refresh. Issue #514
- Fix layout tool group locations. PR #526
- Fix slider not sending if past end of widget.

### 2.16.0: Milestone Release

Expand All @@ -12,7 +14,6 @@
- Add Dashboard Layout tool - Major contribution - Thanks @KazuhiroItoh - PR #482
- Add ui.isDark() returns true/false if overall theme is dark or light, so the widget could switch appropriately. (can already use getTheme() to get actual colors if needs be.)


**Fixes**

- Make spacer transparent so background is really the background.
Expand Down
2 changes: 1 addition & 1 deletion dist/dashboard.appcache
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ fonts/weather-icons-lite.woff2
NETWORK:
*

# hash: 8a5a27b1b3e0752f766fd30d3aef8dab54f94ffd3cef3367cb8682398d02c5f4
# hash: c7a9da31046037ec87dbb181b5f538434256aa3b2757b1b0203472aef39d5e06
4 changes: 2 additions & 2 deletions dist/js/app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-dashboard",
"version": "2.16.1-beta",
"version": "2.16.1",
"description": "A set of dashboard nodes for Node-RED",
"keywords": [
"node-red"
Expand Down
3 changes: 3 additions & 0 deletions src/components/ui-component/templates/slider.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
step="{{me.item.step}}"
ng-model="me.item.value"
aria-label="{{me.item.label}}"
ng-change="me.mchange()"
ng-mouseup="me.valueChanged(10)"
ng-mousedown="me.mdown()"
ng-mouseleave="me.mleave()"
style="z-index:1; touch-action:none; min-width:32px;"
ng-style="(me.item.width >= me.item.height) && {'margin-top':'20px'};"
ng-attr-md-vertical="{{ (me.item.width < me.item.height) || undefined}}"
Expand Down
10 changes: 9 additions & 1 deletion src/components/ui-component/ui-component-ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,20 @@ angular.module('ui').controller('uiComponentController', ['$scope', 'UiEvents',
}
break;
}

case 'slider': {
me.active = false;
me.mdown = function() { me.active = true; };
me.mleave = function() { me.active = false; };
me.mchange = function() { events.emit({ id:me.item.id, value:me.item.value });}
break;
}
}
}

me.valueChanged = function (throttleTime) {
throttle({ id:me.item.id, value:me.item.value },
typeof throttleTime === "number" ? throttleTime : 10);
typeof throttleTime === "number" ? throttleTime : 10);
};

// will emit me.item.value when enter or tab is pressed or onBlur
Expand Down

0 comments on commit a2b9286

Please sign in to comment.