moved getState method in admin-all so it's always available

This commit is contained in:
Djamil Legato
2015-08-03 12:55:00 -07:00
parent cf2c727666
commit d081a39439
3 changed files with 13 additions and 13 deletions

View File

@@ -1,3 +1,15 @@
var getState = function(){
var loadValues = [];
$('input, select, textarea').each(function(index, element){
var name = $(element).prop('name'),
value = $(element).val();
if (name) loadValues.push(name + '|' + value);
});
return loadValues.toString();
};
$(function () {
jQuery.substitute = function(str, sub) {
return str.replace(/\{(.+?)\}/g, function($0, $1) {

View File

@@ -115,7 +115,7 @@
this.scanned = true;
//Refresh root.currentValues as toggleables have been initialized
(root || window.GravJS).currentValues = getState();
root.currentValues = getState();
};
Form.factories = {};

View File

@@ -1,15 +1,3 @@
var getState = function(){
var loadValues = [];
$('input, select, textarea').each(function(index, element){
var name = $(element).prop('name'),
value = $(element).val();
if (name) loadValues.push(name + '|' + value);
});
return loadValues.toString();
};
$(function(){
var root = window || {};
root = root.GravJS = root.GravJS || {};