mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-15 04:15:28 +03:00
GUI improvements
This commit is contained in:
parent
e23a8a5189
commit
57f7035ef0
4 changed files with 37 additions and 14 deletions
|
@ -22,6 +22,16 @@ let LogicConditionsCollection = function () {
|
||||||
return data.length
|
return data.length
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.open = function () {
|
||||||
|
|
||||||
|
if (semver.lt(CONFIG.flightControllerVersion, "2.2.0")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.render();
|
||||||
|
$container.show();
|
||||||
|
};
|
||||||
|
|
||||||
self.render = function () {
|
self.render = function () {
|
||||||
let $table = $container.find(".logic__table")
|
let $table = $container.find(".logic__table")
|
||||||
$table.find("tbody tr").remove();
|
$table.find("tbody tr").remove();
|
||||||
|
@ -31,6 +41,8 @@ let LogicConditionsCollection = function () {
|
||||||
self.get()[k].render(k, $table);
|
self.get()[k].render(k, $table);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GUI.switchery();
|
||||||
};
|
};
|
||||||
|
|
||||||
self.onSave = function () {
|
self.onSave = function () {
|
||||||
|
@ -49,6 +61,11 @@ let LogicConditionsCollection = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
self.init = function ($element) {
|
self.init = function ($element) {
|
||||||
|
|
||||||
|
if (semver.lt(CONFIG.flightControllerVersion, "2.2.0")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$container = $element;
|
$container = $element;
|
||||||
|
|
||||||
$container.find('.logic__save').click(self.onSave);
|
$container.find('.logic__save').click(self.onSave);
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
.logic__background {
|
.logic__background {
|
||||||
position: absolute;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
background: black;
|
background: black;
|
||||||
opacity: 0.75;
|
opacity: 0.75;
|
||||||
z-index: 2000;
|
z-index: 2001;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logic__content {
|
.logic__content {
|
||||||
position: absolute;
|
position: fixed;
|
||||||
top: 2em;
|
top: 2em;
|
||||||
bottom: 2em;
|
bottom: 2em;
|
||||||
left: 4em;
|
left: 4em;
|
||||||
right: 4em;
|
right: 4em;
|
||||||
background-color: #efefef;
|
background-color: #efefef;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
z-index: 2001;
|
z-index: 2002;
|
||||||
padding: 2em;
|
padding: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,8 @@
|
||||||
<!-- middle roew -->
|
<!-- middle roew -->
|
||||||
<div class="clear-both"></div>
|
<div class="clear-both"></div>
|
||||||
<!-- bottom row -->
|
<!-- bottom row -->
|
||||||
<div>
|
<!-- <div> -->
|
||||||
<div class="leftWrapper">
|
<!-- <div class="leftWrapper"> -->
|
||||||
<div class="motor-mixer gui_box grey">
|
<div class="motor-mixer gui_box grey">
|
||||||
<div class="gui_box_titlebar">
|
<div class="gui_box_titlebar">
|
||||||
<div class="spacer_box_title" data-i18n="motorMixer"></div>
|
<div class="spacer_box_title" data-i18n="motorMixer"></div>
|
||||||
|
@ -97,8 +97,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- </div> -->
|
||||||
<div class="rightWrapper">
|
<!-- <div class="rightWrapper"> -->
|
||||||
<div class="motor-mixer gui_box grey">
|
<div class="motor-mixer gui_box grey">
|
||||||
<div class="gui_box_titlebar">
|
<div class="gui_box_titlebar">
|
||||||
<div class="spacer_box_title" data-i18n="servoMixer"></div>
|
<div class="spacer_box_title" data-i18n="servoMixer"></div>
|
||||||
|
@ -118,15 +118,18 @@
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<div class="btn default_btn narrow pull-left mixer_btn_add">
|
||||||
|
<a href="#" data-role="role-logic-conditions-open" data-i18n="tabLogicConditions"></a>
|
||||||
|
</div>
|
||||||
<div class="btn default_btn narrow pull-right green mixer_btn_add">
|
<div class="btn default_btn narrow pull-right green mixer_btn_add">
|
||||||
<a href="#" data-role="role-servo-add" data-i18n="servoMixerAdd"></a>
|
<a href="#" data-role="role-servo-add" data-i18n="servoMixerAdd"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- </div> -->
|
||||||
</div>
|
<!-- </div> -->
|
||||||
|
|
||||||
<div id="logic-wrapper">
|
<div id="logic-wrapper" style="display: none">
|
||||||
<div class="logic__background"></div>
|
<div class="logic__background"></div>
|
||||||
<div class="logic__content">
|
<div class="logic__content">
|
||||||
<div class="tab_title" data-i18n="tabLogicConditions"></div>
|
<div class="tab_title" data-i18n="tabLogicConditions"></div>
|
||||||
|
|
|
@ -369,6 +369,10 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("[data-role='role-logic-conditions-open']").click(function () {
|
||||||
|
LOGIC_CONDITIONS.open();
|
||||||
|
});
|
||||||
|
|
||||||
$('#save-button').click(saveAndReboot);
|
$('#save-button').click(saveAndReboot);
|
||||||
|
|
||||||
renderServoMixRules();
|
renderServoMixRules();
|
||||||
|
@ -377,11 +381,10 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
|
||||||
renderOutputTable();
|
renderOutputTable();
|
||||||
renderOutputMapping();
|
renderOutputMapping();
|
||||||
|
|
||||||
localize();
|
|
||||||
|
|
||||||
LOGIC_CONDITIONS.init($('#logic-wrapper'));
|
LOGIC_CONDITIONS.init($('#logic-wrapper'));
|
||||||
LOGIC_CONDITIONS.render();
|
|
||||||
|
|
||||||
|
localize();
|
||||||
|
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue