1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 18:17:58 +01:00

Make further use of default parameters.

--HG--
extra : rebase_source : ab666bce7ed7e47c8f1e2bc4145f553da990d319
This commit is contained in:
Doug Kearns
2013-10-06 22:33:59 +11:00
parent cf7e0c479d
commit 4872666ef5
18 changed files with 49 additions and 85 deletions

View File

@@ -866,9 +866,7 @@ var CommandLine = Module("commandline", {
* @... {string} default - The initial value that will be returned
* if the user presses <CR> straightaway. @default ""
*/
input: function _input(prompt, callback, extra) {
extra = extra || {};
input: function _input(prompt, callback, extra = {}) {
CommandPromptMode(prompt, update({ onSubmit: callback }, extra)).open();
},
@@ -1396,10 +1394,8 @@ var CommandLine = Module("commandline", {
* @default {@link #selected}
* @returns {object}
*/
getItem: function getItem(tuple) {
tuple = tuple || this.selected;
return tuple && tuple[0] && tuple[0].items[tuple[1]];
},
getItem: function getItem(tuple = this.selected)
tuple && tuple[0] && tuple[0].items[tuple[1]],
/**
* Returns a tuple representing the next item, at the given
@@ -1510,11 +1506,10 @@ var CommandLine = Module("commandline", {
* @default 1
* @param {boolean} fromTab If true, this function was
* called by {@link #tab}.
* @default false
* @private
*/
select: function select(idx, count, fromTab) {
count = count || 1;
select: function select(idx, count = 1, fromTab = false) {
switch (idx) {
case this.UP:
case this.DOWN: