History

js: mp.add_key_binding: allow false-y name (match 311cc5b)

This is in addition to the allowed omission of name and/or flags (as documented).

Avi Halachmi (:avih) committed 6 years ago

Commit b67d1241 parent abf6b221 file · +3 −1Browse files

Showing the changes to player/javascript (1 of 1 file). Show all

Unified · Split

player/javascript/defaults.js+3−1
@@ -204,8 +204,10 @@ function add_binding(forced, key, name, fn, opts) { · 203 unmodified lines
204 if (typeof name == "function") { // as if "name" is not part of the args204 if (typeof name == "function") { // as if "name" is not part of the args
205 opts = fn;205 opts = fn;
206 fn = name;206 fn = name;
207 name = "__keybinding" + next_bid++; // new unique binding name207 name = false;
208 }208 }
209 if (!name)
210 name = "__keybinding" + next_bid++; // new unique binding name
209 var key_data = {forced: forced};211 var key_data = {forced: forced};
210 switch (typeof opts) { // merge opts into key_data212 switch (typeof opts) { // merge opts into key_data
211 case "string": key_data[opts] = true; break;213 case "string": key_data[opts] = true; break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t