Skip to content

Commit

Permalink
docs: comments comments comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgurney committed Mar 20, 2024
1 parent 5d72303 commit 7a83665
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions src/Settings/ToolbarSettingsModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ export default class ToolbarSettingsModal extends Modal {
this.toolbar = toolbar;
}

/**
* Displays the toolbar item's settings within the modal window.
*/
onOpen() {
this.display();
}

/**
* Removes modal window and refreshes the parent settings window.
*/
onClose() {
const { contentEl } = this;
contentEl.empty();
Expand All @@ -33,7 +39,7 @@ export default class ToolbarSettingsModal extends Modal {
*************************************************************************/

/**
*
* Displays the toolbar item's settings.
*/
public display() {

Expand All @@ -60,8 +66,8 @@ export default class ToolbarSettingsModal extends Modal {
}

/**
*
* @param settingsDiv HTMLElement to add the settings to.
* Displays the Name setting.
* @param settingsDiv HTMLElement to add the setting to.
*/
displayNameSetting(settingsDiv: HTMLElement) {

Expand Down Expand Up @@ -94,7 +100,7 @@ export default class ToolbarSettingsModal extends Modal {
}

/**
*
* Displays the list of toolbar items for editing.
* @param settingsDiv HTMLElement to add the settings to.
*/
displayItemList(settingsDiv: HTMLElement) {
Expand Down Expand Up @@ -274,7 +280,7 @@ export default class ToolbarSettingsModal extends Modal {
}

/**
*
* Displays the Style settings.
* @param settingsDiv HTMLElement to add the settings to.
*/
displayStyleSetting(settingsDiv: HTMLElement) {
Expand Down Expand Up @@ -427,7 +433,7 @@ export default class ToolbarSettingsModal extends Modal {
}

/**
*
* Displays the Delete button.
* @param settingsDiv HTMLElement to add the settings to.
*/
displayDeleteButton(settingsDiv: HTMLElement) {
Expand All @@ -454,8 +460,14 @@ export default class ToolbarSettingsModal extends Modal {
* UTILITIES
*************************************************************************/

getValueForKey(styleDict: {[key: string]: string}[], key: string): string {
const option = styleDict.find(option => key in option);
/**
* Returns the value for the provided key from the provided dictionary.
* @param dict key-value dictionary
* @param key string key
* @returns value from the dictionary
*/
getValueForKey(dict: {[key: string]: string}[], key: string): string {
const option = dict.find(option => key in option);
return option ? Object.values(option)[0] : 'INVALID OPTION';
}

Expand Down

0 comments on commit 7a83665

Please sign in to comment.