mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-07 12:47:41 +01:00
Correzioni JS minori
This commit is contained in:
parent
bf599b0b2e
commit
c162c0dbab
@ -32,10 +32,21 @@ Input.prototype.setDisabled = function (value) {
|
||||
Input.prototype.disable = function () {
|
||||
this.element.addClass("disabled")
|
||||
.attr("disabled", true)
|
||||
.attr("readonly", false)
|
||||
.attr("required", false);
|
||||
|
||||
let group = this.element.closest(".form-group");
|
||||
|
||||
// Disabilitazione eventuali pulsanti relativi
|
||||
this.element.closest(".form-group").find("button")
|
||||
group.find("button")
|
||||
.addClass("disabled");
|
||||
|
||||
// Disabilitazione per checkbox
|
||||
group.find(".btn-group label")
|
||||
.addClass("disabled");
|
||||
group.find("input[type=checkbox]")
|
||||
.attr("disabled", true)
|
||||
.attr("readonly", false)
|
||||
.addClass("disabled");
|
||||
|
||||
return this;
|
||||
@ -44,10 +55,21 @@ Input.prototype.disable = function () {
|
||||
Input.prototype.enable = function () {
|
||||
this.element.removeClass("disabled")
|
||||
.attr("disabled", false)
|
||||
.attr("readonly", false)
|
||||
.attr("required", this.element.data("required"));
|
||||
|
||||
let group = this.element.closest(".form-group");
|
||||
|
||||
// Abilitazione eventuali pulsanti relativi
|
||||
this.element.closest(".form-group").find("button")
|
||||
group.find("button")
|
||||
.removeClass("disabled");
|
||||
|
||||
// Abilitazione per checkbox
|
||||
group.find(".btn-group label")
|
||||
.removeClass("disabled");
|
||||
group.find("input[type=checkbox]")
|
||||
.attr("disabled", false)
|
||||
.attr("readonly", false)
|
||||
.removeClass("disabled");
|
||||
|
||||
return this;
|
||||
|
13
editor.php
13
editor.php
@ -433,7 +433,9 @@ if ($read_only || !empty($block_edit)) {
|
||||
echo '
|
||||
$(document).ready(function(){
|
||||
$("input, textarea, select", "section.content")'.$not.'.attr("readonly", "true");
|
||||
$("select, input[type=checkbox]", "section.content")'.$not.'.prop("disabled", true);';
|
||||
$("select, input[type=checkbox]", "section.content")'.$not.'.prop("disabled", true);
|
||||
$(".checkbox-buttons label", "section.content")'.$not.'.addClass("disabled");
|
||||
';
|
||||
|
||||
if ($read_only) {
|
||||
echo '
|
||||
@ -450,7 +452,7 @@ if ($read_only || !empty($block_edit)) {
|
||||
|
||||
//controllo se digito qualche valore o cambio qualche select
|
||||
$("input, textarea, select").bind("change paste keyup", function(event) {
|
||||
if( event.keyCode >= 32 ){
|
||||
if (event.keyCode >= 32) {
|
||||
content_was_modified = true;
|
||||
}
|
||||
});
|
||||
@ -459,18 +461,17 @@ if ($read_only || !empty($block_edit)) {
|
||||
content_was_modified = true;
|
||||
});
|
||||
|
||||
|
||||
//tolgo il controllo se sto salvando
|
||||
$(".btn-success, button[type=submit]").bind("click", function() {
|
||||
content_was_modified = false;
|
||||
});
|
||||
|
||||
$( "form" ).bind( "submit", function() {
|
||||
$("form").bind("submit", function() {
|
||||
content_was_modified = false;
|
||||
})
|
||||
});
|
||||
|
||||
// questo controllo blocca il modulo vendita al banco, dopo la lettura con barcode, appare il messaggio di conferma
|
||||
window.onbeforeunload = function(e){
|
||||
window.onbeforeunload = function(e) {
|
||||
if(content_was_modified) {
|
||||
var dialogText = "Uscire senza salvare?";
|
||||
e.returnValue = dialogText;
|
||||
|
@ -394,7 +394,6 @@ echo '
|
||||
input("idimpianti").getElement().selectReset();
|
||||
|
||||
let data = sede.getData();
|
||||
console.log(data);
|
||||
if (data) {
|
||||
input("idzona").set(data.idzona ? data.idzona : "");
|
||||
// session_set("superselect,idzona", $(this).selectData().idzona, 0);
|
||||
|
@ -57,7 +57,7 @@ class ChoicesHandler implements HandlerInterface
|
||||
<div class="form-group">
|
||||
<input type="hidden" name="|name|" value="|value|">
|
||||
<input type="checkbox" id="|id|" value="|value|" autocomplete="off" class="hidden" |attr| onchange="$(this).parent().find(\'[type = hidden]\').val(+this.checked)"/>
|
||||
<div class="btn-group">
|
||||
<div class="btn-group checkbox-buttons">
|
||||
<label for="|id|" class="btn btn-default'.$class.'">
|
||||
<span class="fa fa-check text-success"></span>
|
||||
<span class="fa fa-close text-danger"></span>
|
||||
|
Loading…
x
Reference in New Issue
Block a user