MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Problem mit MMM-Fuel (Textausrichtung)

    Scheduled Pinned Locked Moved Troubleshooting
    12 Posts 3 Posters 3.2k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      Sven1894 @Pielo
      last edited by

      @Pielo Hmmm… Für mich sieht es so aus als sei die Schrift nur in der Tabelle zentriert und nicht im ganzen Modul. Die Überschrift vom Modul ist ja linksbündig. Versuch mal folgendes:

      .MMM-Fuel .table {
          border-spacing: 10px 0;
          border-collapse: separate;
          text-align: left;
      }
      
      P 2 Replies Last reply Reply Quote 0
      • P Offline
        Pielo @Sven1894
        last edited by

        @Sven1894

        Stimmt, auch die Überschriften der anderen zwei Spalten sind rechtsbündig. Leider hat aber deine Idee nicht funktioniert. Ich habe es hier noch mal ein besseres Bild angehängt. Vielleicht fällt dir ja noch was ein.

        alt text

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          Sven1894 @Pielo
          last edited by

          @Pielo Kannst du mir vielleicht noch deine custom.css zeigen? Vielleicht kann ich da etwas finden.

          P 1 Reply Last reply Reply Quote 0
          • P Offline
            Pielo @Sven1894
            last edited by

            @Sven1894

            Die ist (bis jetzt) ohne Inhalt.
            Kann doch nicht sein, das es bei mir so problematisch ist…

            1 Reply Last reply Reply Quote 0
            • P Offline
              Pielo @Sven1894
              last edited by Pielo

              Ich bin zu einer neuen Erkenntniss gekommen. Wenn ich das Wettermodul entferne ist es linksbündig. Zwar immernoch nur ein Buchstabe, aber schon mal was. Das selbe ist auch, wenn ich alle anderen Module entferne.

              Die Funktion zu “shortenText” ist folgende. Kann man da evtl erkennen warum nur ein Buchstabe angezeigt wird. Muss irgendwo noch ne breite deklariert werden?

                /**
                  * @function shortenText
                  * @description Shortens text based on config option (shortenText) and adds ellipsis at the end.
                  *
                  * @param {string} text - Text which should be shorten.
                  *
                  * @returns {string} The shortened text.
                  */
                 shortenText(text) {
                     let temp = text;
                     if (this.config.shortenText && temp.length > this.config.shortenText) {
                         temp = `${temp.slice(0, this.config.shortenText)}…`;
                     }
                     return temp;
                 },
              

              alt text

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                Sven1894 @Pielo
                last edited by

                @Pielo Kannst du mir mal die css des Wettermoduls zeigen?
                Davon abgesehen solltest du Änderungen in css lieber in der custom css machen und die css-Dateien der Module nicht verändern.

                Ich bin zwar kein JavaScript Profi, aber ich versuche mal zu helfen.
                Bei der slice Funktion muss, soweit ich weiß, als Startwert ein Integer und als Endwert ein Integer angegeben werden. “this.config.shortenText” ist aber ein boolean, oder? Meine Vermutung ist, dass das der Fehler ist.
                Aber wie gesagt, ich bin kompletter Anfänger was JavaScript angeht, kann auch sein, dass ich hier völligen Blödsinn erzähle.

                1 Reply Last reply Reply Quote 0
                • C Offline
                  chris47803
                  last edited by

                  Hallo,

                  ich habe das gleiche Problem.
                  Eine Kollision mit anderen Modulen kann ich ausschließen.
                  Es kommt auch immer drauf an welche Tankstellen von Tankerkönig über die API kommen.
                  ShortenText auf true zeigt nur einen Buchstaben an, was nichts nützt.

                  Hat schon Jemand eine Lösung gefunden?

                  C 1 Reply Last reply Reply Quote 0
                  • C Offline
                    chris47803 @chris47803
                    last edited by

                    @chris47803 said in Problem mit MMM-Fuel (Textausrichtung):

                    Hallo,

                    ich habe das gleiche Problem.
                    Eine Kollision mit anderen Modulen kann ich ausschließen.
                    Es kommt auch immer drauf an welche Tankstellen von Tankerkönig über die API kommen.
                    ShortenText auf true zeigt nur einen Buchstaben an, was nichts nützt.

                    Hat schon Jemand eine Lösung gefunden?

                    Hello,

                    I have the same problem.
                    I can rule out a collision with other modules.
                    It always depends on which petrol stations from Tankerkönig come via the API.
                    ShortenText to true only shows one letter, which is of no use.

                    Has anyone found a solution yet?

                    C 1 Reply Last reply Reply Quote 0
                    • C Offline
                      chris47803 @chris47803
                      last edited by

                      Ich klatsch mir vor die Stirn. :)

                      Bei ShortenText habe ich nun statt true oder false den Wert 50 eingetragen.
                      Nun passt es.

                      LG, Chris

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy