blob: f3f7b42e1dba02b923cd3ba7b7f8f690bda34ffd [file] [log] [blame]
Leo Repp56904d22021-04-26 15:53:22 +02001/**
2 * An entry in menus that is always
3 * displayed, with a string and onClick functionality
4 * uses menu/prefix.js as prototype and doesn't change much, all
5 * functionality comes from the alwaysmenu
6 *
7 *
8 * @author Leo Repp
9 */
10
11
12"use strict";
13
14define([
15 'menu/prefix'
16], function (prefixClass) {
17
18 return {
19
20 /**
21 * Create new always visible menu entry object.
22 * Like a prefix Object, always visible, for some defined action
23 */
24 create : function (text) {
25 const obj = prefixClass.create()
26 .upgradeTo(this)
27 ._init();
28 obj._el.innerHTML = text || "Speichern";
29 //dont forget to adjust alwaysMenuSpec - alwaysEntry!
30 return obj;
31 },
32
33 _update : function () {
34 if (this._string.length!==0){ // I assume that this is a sufficient criterium for infering that the prefix is active
35 this._el.style.bottom="-27px";
36 } else if (this._string.length===0) {
37 this._el.style.bottom="0px";
38 }
39 return this._string; // No need to change the text (=innerHTML)
40 },
41
42 };
43});