Get 2024 Templates Mega Bundle!19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets
Get for 99$

Rails bug report: defaultThemeMode and jstree images


Hello, found two issues in the Rails starter app for Metronic 8.1.7 with the initial default theme and then with jstree.

First, app/views/partials/theme-mode/_init.html.erb has a typo that causes formatting issues until the light, dark, or system theme is selected by the user.

Line 3 of the file is currently set to:
var defaultThemeMode = "{% getModeDefault %}";
but needs to be set to:
var defaultThemeMode = "<%= getModeDefault() %>";

Second, the jstree plugin uses four .png and two .gif files, but the current CSS file doesn't point to those files correctly.

For example, in lib/assets/plugins/custom/jstree/jstree.bundle.css:

#jstree-dnd.jstree-dnd-responsive > .jstree-ok {
background-image: url("images/jstree/40px.png");
background-position: 0 -200px;
background-size: 120px 240px;
}


As a quick fix, I pointed to the CDN versions, but I'm sure there's a better way to fix this.
For example:

#jstree-dnd.jstree-dnd-responsive > .jstree-ok {
background-image: url("https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.14/themes/default/40px.png");
background-position: 0 -200px;
background-size: 120px 240px;
}


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


Hi Ian Adams,

Thank you for your feedback. Appreciate your help with suggested fixes. We will include the fix as soon as possible.

Thanks



The corrected line should read:
var defaultThemeMode = "< %= getModeDefault() % >";
(remove the space between the < and %)


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(