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