Skip to content

Commit

Permalink
Update Materialize to latest version (select bugfix).
Browse files Browse the repository at this point in the history
Finally the select reinitialisation bug has been fixed by adding a destroy command.
  • Loading branch information
carlosperate committed Apr 1, 2015
1 parent abf33f7 commit a04b38e
Show file tree
Hide file tree
Showing 4 changed files with 337 additions and 236 deletions.
9 changes: 6 additions & 3 deletions apps/arduino/arduino_material.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,13 @@ ArduinoMaterial.setArduinoBoardsHtml = function(newEl) {
if (newEl != null) {
var boardDropdown = document.getElementById('board');
if (boardDropdown != null) {
// Restarting the select elements built by materialize
$('select').material_select('destroy');
newEl.name = 'settings_board';
newEl.id = 'board';
newEl.onchange = ArduinoMaterial.setBoard;
boardDropdown.parentNode.replaceChild(newEl, boardDropdown);
// Refresh the materialize select menus
// TODO: Currently a reported bug from Materialize
$('select').material_select();
}
} else {
Expand Down Expand Up @@ -282,12 +283,13 @@ ArduinoMaterial.setSerialPortsHtml = function(newEl) {
if (newEl != null) {
var serialDropdown = document.getElementById('serial_port');
if (serialDropdown != null) {
// Restarting the select elements built by materialize
$('select').material_select('destroy');
newEl.name = 'settings_serial';
newEl.id = 'serial_port';
newEl.onchange = ArduinoMaterial.setSerial;
serialDropdown.parentNode.replaceChild(newEl, serialDropdown);
// Refresh the materialize select menus
// TODO: Currently a reported bug from Materialize
$('select').material_select();
}
} else {
Expand Down Expand Up @@ -317,12 +319,13 @@ ArduinoMaterial.setIdeHtml = function(newEl) {
if (newEl != null) {
var ideDropdown = document.getElementById('ide_settings');
if (ideDropdown != null) {
// Restarting the select elements built by materialize
$('select').material_select('destroy');
newEl.name = 'settings_ide';
newEl.id = 'ide_settings';
newEl.onchange = ArduinoMaterial.setIdeSettings;
ideDropdown.parentNode.replaceChild(newEl, ideDropdown);
// Refresh the materialize select menus
// TODO: Currently a reported bug from Materialize
$('select').material_select();
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion apps/arduino/materialize/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ This folder contains the CSS and Javascript for the Materialize CSS framework.

https://github.com/Dogfalo/materialize

Current version used: >0.95.3 [@cec8a7ab9ea92f06d2cc79c0c716447150e4b3a1 commit](https://github.com/Dogfalo/materialize/commit/cec8a7ab9ea92f06d2cc79c0c716447150e4b3a1)
Current version used: >0.95.3 [@a56d8e66e99086eb46c3a5ca1a835dc7d571f57e commit](https://github.com/Dogfalo/materialize/commit/a56d8e66e99086eb46c3a5ca1a835dc7d571f57e)

0 comments on commit a04b38e

Please sign in to comment.