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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user