Skip to content

Commit b4b89a2

Browse files
Merge pull request #32 from aphotix/master
Fix for stripped html on dropdown clear
2 parents d0c4db2 + 8e318da commit b4b89a2

6 files changed

+26
-23
lines changed

angular-semantic-ui.js

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* semantic-ui-angular-jquery - 0.2.3
2+
* semantic-ui-angular-jquery - 0.2.4
33
* Angular Directives for Semantic UI
4-
*
4+
*
55
* https://github.com/ClickerMonkey/SemanticUI-Angular
66
* Released under the MIT license.
77
* Copyright 2017 Philip Diffenderfer and contributors.
@@ -228,34 +228,34 @@ angular.module('semantic-ui', [
228228

229229
}, true );
230230
},
231-
watcher: function (scope, expression, func, context, force, equals)
231+
watcher: function (scope, expression, func, context, force, equals)
232232
{
233233
var currentValue = angular.copy(scope[expression]);
234234

235-
scope.$watch(expression, function (updated)
235+
scope.$watch(expression, function (updated)
236236
{
237-
if (expression != 'model' || !angular.equals(currentValue, updated))
237+
if (expression != 'model' || !angular.equals(currentValue, updated))
238238
{
239239
func.call(context, updated);
240240
}
241241

242242
}, equals);
243243

244244
return {
245-
set: function (value)
245+
set: function (value)
246246
{
247-
if (scope[expression] != value || force)
247+
if (scope[expression] != value || force)
248248
{
249-
scope.$evalAsync(function ()
249+
scope.$evalAsync(function ()
250250
{
251251
scope[expression] = value;
252252
currentValue = angular.copy(scope[expression]);
253253
});
254254
}
255255
},
256-
update: function ()
256+
update: function ()
257257
{
258-
scope.$evalAsync(function ()
258+
scope.$evalAsync(function ()
259259
{
260260
});
261261
}
@@ -1287,9 +1287,11 @@ angular.module('semantic-ui', [
12871287
return function (scope, element, attributes) {
12881288
var applyValue = function (value) {
12891289
$timeout(function () {
1290-
if (value == null) {
1290+
if (value === null) {
12911291
element.dropdown('clear');
1292-
}
1292+
} else if(value === false){
1293+
// Do nothing
1294+
}
12931295
else if (element.dropdown('is multiple')) {
12941296
if (value instanceof Array) {
12951297
var translatedValue = [];

angular-semantic-ui.min.js

+4-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

angular-semantic-ui.min.js.map

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "semantic-ui-angular-jquery",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"homepage": "https://github.com/ClickerMonkey/SemanticUI-Angular",
55
"authors": [
66
"Philip Diffenderfer <[email protected]>"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "semantic-ui-angular-jquery",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "Angular Directives for Semantic UI",
55
"author": "Philip Diffenderfer",
66
"license": "MIT",

src/dropdown/sm-dropdown.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@
162162
return function (scope, element, attributes) {
163163
var applyValue = function (value) {
164164
$timeout(function () {
165-
if (value == null) {
165+
if (value === null) {
166166
element.dropdown('clear');
167-
}
167+
} else if(value === false){
168+
// Do nothing
169+
}
168170
else if (element.dropdown('is multiple')) {
169171
if (value instanceof Array) {
170172
var translatedValue = [];

0 commit comments

Comments
 (0)