mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2025-06-11 09:23:17 +02:00
Moved retrieve printer types list to PrinterPanel
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
function PrinterPanel() {
|
||||
|
||||
this.printerType;
|
||||
var _api = new PrinterAPI();
|
||||
var _form = new FormPanel();
|
||||
|
||||
// ui elements
|
||||
@ -21,8 +22,8 @@ function PrinterPanel() {
|
||||
this.init = function(wifiboxURL,wifiboxCGIBinURL,panelElement) {
|
||||
|
||||
_form.init(wifiboxURL,wifiboxCGIBinURL,panelElement)
|
||||
_api.init(wifiboxURL,wifiboxCGIBinURL);
|
||||
_element = panelElement;
|
||||
|
||||
_printerSelector = _element.find("#printerType");
|
||||
_printerSelector.change(_self.printerSelectorChanged);
|
||||
|
||||
@ -33,6 +34,16 @@ function PrinterPanel() {
|
||||
var gcodePanel = _element.find("#gcodePanel");
|
||||
gcodePanel.coolfieldset({collapsed:true});
|
||||
}
|
||||
this.load = function(completeHandler) {
|
||||
|
||||
_api.listAll(function(data) {
|
||||
$.each(data.printers, function(key, value) {
|
||||
// console.log(key,value);
|
||||
$('#printerType').append($('<option>').text(value).attr('value', key));
|
||||
});
|
||||
completeHandler();
|
||||
});
|
||||
}
|
||||
this.printerSelectorChanged = function(e) {
|
||||
_self.printerType = _printerSelector.find("option:selected").val();
|
||||
var settings = {};
|
||||
|
Reference in New Issue
Block a user