Skip to content

Commit

Permalink
Fix undefined placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed May 23, 2017
1 parent aacde33 commit ba9cd9b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/Ui/media/Wrapper.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,10 @@ class Wrapper
message.params = @toHtmlSafe(message.params) # Escape html
if message.params[1] then type = message.params[1] else type = "text"
caption = if message.params[2] then message.params[2] else "OK"
placeholder = message.params[3]
if message.params[3]?
placeholder = message.params[3]
else
placeholder = ""

@displayPrompt message.params[0], type, caption, placeholder, (res) =>
@sendInner {"cmd": "response", "to": message.id, "result": res} # Response to confirm
Expand Down
6 changes: 5 additions & 1 deletion src/Ui/media/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,11 @@ jQuery.extend( jQuery.easing,
type = "text";
}
caption = message.params[2] ? message.params[2] : "OK";
placeholder = message.params[3];
if (message.params[3] != null) {
placeholder = message.params[3];
} else {
placeholder = "";
}
return this.displayPrompt(message.params[0], type, caption, placeholder, (function(_this) {
return function(res) {
return _this.sendInner({
Expand Down

0 comments on commit ba9cd9b

Please sign in to comment.