MCPcopy Index your code
hub / github.com/json-editor/json-editor / getButton

Method getButton

src/editor.js:347–363  ·  view source on GitHub ↗
(text, icon, title, args = [])

Source from the content-addressed store, hash-verified

345 onMove () {}
346
347 getButton (text, icon, title, args = []) {
348 const btnClass = `json-editor-btn-${icon}`
349 if (!this.iconlib) icon = null
350 else icon = this.iconlib.getIcon(icon)
351
352 text = this.translate(text, args)
353 title = this.translate(title, args)
354
355 if (!icon && title) {
356 text = title
357 title = null
358 }
359
360 const btn = this.theme.getButton(text, icon, title)
361 btn.classList.add(btnClass)
362 return btn
363 }
364
365 setButtonText (button, text, icon, title, args = []) {
366 if (!this.iconlib) icon = null

Callers

nothing calls this directly

Calls 2

addMethod · 0.80
getIconMethod · 0.45

Tested by

no test coverage detected