{"version":3,"sources":["../../../config-wrap-start-default.js","../lib/almond.js","views/emptyCell.js","views/cellItem.js","models/cellFieldCollection.js","views/rowItem.js","views/rowCollection.js","models/cellModel.js","models/cellCollection.js","models/rowModel.js","models/rowCollection.js","controllers/data.js","controllers/maxCols.js","controllers/addField.js","controllers/cellSortable.js","controllers/gutterDroppable.js","controllers/rowsSortable.js","controllers/undo.js","controllers/updateFieldOrder.js","controllers/loadControllers.js","controllers/loadContent.js","main.js"],"names":["requirejs","require","define","undef","hasProp","obj","prop","hasOwn","call","normalize","name","baseName","nameParts","nameSegment","mapValue","foundMap","lastIndex","foundI","foundStarMap","starI","i","j","part","baseParts","split","map","config","starMap","charAt","length","nodeIdCompat","jsSuffixRegExp","test","replace","slice","concat","splice","join","indexOf","substring","makeRequire","relName","forceSync","args","aps","arguments","push","req","apply","makeNormalize","makeLoad","depName","value","defined","callDep","waiting","defining","main","Error","splitPrefix","prefix","index","makeConfig","makeMap","handlers","Object","prototype","hasOwnProperty","plugin","parts","f","n","pr","p","exports","e","module","id","uri","deps","callback","cjsModule","ret","usingExports","callbackType","load","undefined","alt","setTimeout","cfg","_defined","amd","jQuery","Marionette","ItemView","extend","tagname","template","EmptyCell","CollectionView","className","emptyView","dropping","initialize","options","this","collection","model","get","childView","nfRadio","channel","request","cellCollection","onRender","el","data","models","addClass","removeClass","initSortable","that","sortable","cancel","placeholder","opacity","items","tolerance","connectWith","refreshPositions","appendTo","helper","over","ui","trigger","out","sort","receive","item","start","stop","update","templateHelpers","renderHandleBefore","renderHandleAfter","events","click .delete","clickDeleteCell","Backbone","Collection","comparator","listenTo","removeField","_","each","set","cellModel","cid","silent","on","addField","updateCellModel","fieldCollection","removeModel","addModel","order","rowModel","remove","field","add","CellItemView","CellFieldCollection","reorderOnSort","childViewOptions","reply","updateGutters","render","onBeforeDestroy","off","maybeRender","find","rowView","droppable","hoverClass","accept","drop","elements","Split","minSize","onDragStart","onDrag","onDragEnd","cell","width","css","html","before","after","RowItemView","getEmptyView","maybeInitSortable","filter","rowCollection","show","handle","grid","Model","fieldModels","search","findField","findWhere","key","Number","updateRowModel","addCell","updateCellWidths","Math","round","floor","CellCollection","checkEmptyCells","updateMaxCols","appendField","maxCols","row","cells","fieldModel","every","RowCollection","overSortable","outFired","overCell","overRows","addRow","rowOrder","pluck","max","fields","updateOverSortable","val","getOverSortable","updateOutFired","getOutFired","updateOverCell","getOverCell","updateColClass","num","builderEl","builderClass","maybeAddRow","startDragging","stopDragging","received","getHelper","dragFieldType","setDropping","deleteCell","cellView","parent","prev","fieldID","type","oldOrder","isNumeric","newPos","hasClass","receiveNewField","receiveCurrentField","receiveFieldStaging","newModel","sortFields","stagedFields","insertedAt","senderOldOrder","receiverOldOrder","target","height","element","clone","left","top","cellcid","fieldType","tmpID","label","draggable","draggableInstance","helperProportions","newRows","newRowModel","dropped","dragStart","drag","dragEnd","newCell","dropNewField","dropFieldStaging","dropCurrentField","widths","getDraggedWidths","percentLeft","a","percentRight","b","gutter","append","awidth","bwidth","modelA","modelB","oldModelAWidth","oldModelBWidth","renderField","rowsView","rowcid","oldCID","prevOrder","droppedOrder","parseInt","newOrder","newRow","undoMovedBetweenCells","undoGutterDropNewField","undoGutterSplitCell","undoCellSorting","undoRemovedCell","undoCellNewField","undoRowNewField","undoGutterResize","undoMovedToNewRow","undoRowSorting","change","undoAll","originalCollection","newCollection","maybeRemoveChange","enableNextChange","oldCollection","changeCollection","found","changeModel","layouts","updateFieldOrder","rowIndex","cellIndex","fieldIndex","Data","MaxCols","AddField","CellSortable","GutterDroppable","RowsSortable","Undo","UpdateFieldOrder","RowCollectionView","LoadControllers","loadControllers","getFormContentView","formContentSave","formContentLoad","rows","JSON","parse","stringify","formContentData","empty","rowArray","formContentLoadFilters","mpEnabled","isArray","first","flatten","isEmpty","nfLayouts","some","Radio","LoadContent","Application","afterNFLoad","onStart","app"],"mappings":"CAAA,WCUA,GAAAA,GAAAC,EAAAC,GACA,SAAAC,GAUA,QAAAC,GAAAC,EAAAC,G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MAAAN,IAAA,QAAAnN,EAAAyN,MAAAN,GAAAvG,OAKAuG,EAAAnN,EAAA0N,QAAA1N,EAAAkF,MAAAiI,EAAA,oBACAnN,EAAAC,KAAAkN,EAAA,SAAA5I,EAAAnK,GACAmK,EAAA3D,MAAAxG,EAAA,GACA4C,OAGAgD,EAAAwN,QAAAL,IAAA,GAAAA,EAAA/U,YAAA,KAAA+U,EAAA,GAAA3I,MACAxE,EAAAC,KAAAkN,EAAA,SAAAzJ,EAAAtJ,GACAiT,EAAAhU,MACAuH,MAAAxG,EACAoK,QACA5D,MAAA,EACAwE,QAAA1B,GACAlB,MAAA,YAMA6K,EADArN,EAAA2N,QAAAR,IAAA,mBAAAS,aAAAL,EACAK,UAAAb,KAEAI,EAMAE,EAAArN,EAAAgD,OAAAqK,EAAA,SAAA9I,GAKA,MAAAvE,GAAA6N,KAAAtJ,EAAAC,MAAA,SAAAjC,GACA,MAAA,IAAAA,EAAA6C,OAAAhN,WAIA,GAAAuM,GAAA0I,OAMA,IAAAhQ,GAAAsC,SAAAmO,KCjIAtX,IAAA,2BAAA,SAAAuX,IAkBA,IAhBA3R,WAAA4R,YAAA1R,QAEAQ,WAAA,SAAAC,GACAC,KAAA8C,SAAAzC,EAAAC,QAAA,OAAA,iBAAAN,KAAAiR,cAGAC,QAAA,WACA,GAAAH,IAGAE,YAAA,SAAAE,GACA,GAAArI,GAAAzI,EAAAC,QAAA,OAAAC,QAAA,gBACApB,QAAA2J,GAAAjI,SAAA,gBAKAqB,UAEAzI,EAAA,OAAA","file":"builder.js","sourcesContent":["(function () {\n","/**\n * @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/almond for details\n */\n//Going sloppy to avoid 'use strict' string cost, but strict practices should\n//be followed.\n/*jslint sloppy: true */\n/*global setTimeout: false */\n\nvar requirejs, require, define;\n(function (undef) {\n    var main, req, makeMap, handlers,\n        defined = {},\n        waiting = {},\n        config = {},\n        defining = {},\n        hasOwn = Object.prototype.hasOwnProperty,\n        aps = [].slice,\n        jsSuffixRegExp = /\\.js$/;\n\n    function hasProp(obj, prop) {\n        return hasOwn.call(obj, prop);\n    }\n\n    /**\n     * Given a relative module name, like ./something, normalize it to\n     * a real name that can be mapped to a path.\n     * @param {String} name the relative name\n     * @param {String} baseName a real name that the name arg is relative\n     * to.\n     * @returns {String} normalized name\n     */\n    function normalize(name, baseName) {\n        var nameParts, nameSegment, mapValue, foundMap, lastIndex,\n            foundI, foundStarMap, starI, i, j, part,\n            baseParts = baseName && baseName.split(\"/\"),\n            map = config.map,\n            starMap = (map && map['*']) || {};\n\n        //Adjust any relative paths.\n        if (name && name.charAt(0) === \".\") {\n            //If have a base name, try to normalize against it,\n            //otherwise, assume it is a top-level require that will\n            //be relative to baseUrl in the end.\n            if (baseName) {\n                name = name.split('/');\n                lastIndex = name.length - 1;\n\n                // Node .js allowance:\n                if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {\n                    name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');\n                }\n\n                //Lop off the last part of baseParts, so that . matches the\n                //\"directory\" and not name of the baseName's module. For instance,\n                //baseName of \"one/two/three\", maps to \"one/two/three.js\", but we\n                //want the directory, \"one/two\" for this normalization.\n                name = baseParts.slice(0, baseParts.length - 1).concat(name);\n\n                //start trimDots\n                for (i = 0; i < name.length; i += 1) {\n                    part = name[i];\n                    if (part === \".\") {\n                        name.splice(i, 1);\n                        i -= 1;\n                    } else if (part === \"..\") {\n                        if (i === 1 && (name[2] === '..' || name[0] === '..')) {\n                            //End of the line. Keep at least one non-dot\n                            //path segment at the front so it can be mapped\n                            //correctly to disk. Otherwise, there is likely\n                            //no path mapping for a path starting with '..'.\n                            //This can still fail, but catches the most reasonable\n                            //uses of ..\n                            break;\n                        } else if (i > 0) {\n                            name.splice(i - 1, 2);\n                            i -= 2;\n                        }\n                    }\n                }\n                //end trimDots\n\n                name = name.join(\"/\");\n            } else if (name.indexOf('./') === 0) {\n                // No baseName, so this is ID is resolved relative\n                // to baseUrl, pull off the leading dot.\n                name = name.substring(2);\n            }\n        }\n\n        //Apply map config if available.\n        if ((baseParts || starMap) && map) {\n            nameParts = name.split('/');\n\n            for (i = nameParts.length; i > 0; i -= 1) {\n                nameSegment = nameParts.slice(0, i).join(\"/\");\n\n                if (baseParts) {\n                    //Find the longest baseName segment match in the config.\n                    //So, do joins on the biggest to smallest lengths of baseParts.\n                    for (j = baseParts.length; j > 0; j -= 1) {\n                        mapValue = map[baseParts.slice(0, j).join('/')];\n\n                        //baseName segment has  config, find if it has one for\n                        //this name.\n                        if (mapValue) {\n                            mapValue = mapValue[nameSegment];\n                            if (mapValue) {\n                                //Match, update name to the new value.\n                                foundMap = mapValue;\n                                foundI = i;\n                                break;\n                            }\n                        }\n                    }\n                }\n\n                if (foundMap) {\n                    break;\n                }\n\n                //Check for a star map match, but just hold on to it,\n                //if there is a shorter segment match later in a matching\n                //config, then favor over this star map.\n                if (!foundStarMap && starMap && starMap[nameSegment]) {\n                    foundStarMap = starMap[nameSegment];\n                    starI = i;\n                }\n            }\n\n            if (!foundMap && foundStarMap) {\n                foundMap = foundStarMap;\n                foundI = starI;\n            }\n\n            if (foundMap) {\n                nameParts.splice(0, foundI, foundMap);\n                name = nameParts.join('/');\n            }\n        }\n\n        return name;\n    }\n\n    function makeRequire(relName, forceSync) {\n        return function () {\n            //A version of a require function that passes a moduleName\n            //value for items that may need to\n            //look up paths relative to the moduleName\n            var args = aps.call(arguments, 0);\n\n            //If first arg is not require('string'), and there is only\n            //one arg, it is the array form without a callback. Insert\n            //a null so that the following concat is correct.\n            if (typeof args[0] !== 'string' && args.length === 1) {\n                args.push(null);\n            }\n            return req.apply(undef, args.concat([relName, forceSync]));\n        };\n    }\n\n    function makeNormalize(relName) {\n        return function (name) {\n            return normalize(name, relName);\n        };\n    }\n\n    function makeLoad(depName) {\n        return function (value) {\n            defined[depName] = value;\n        };\n    }\n\n    function callDep(name) {\n        if (hasProp(waiting, name)) {\n            var args = waiting[name];\n            delete waiting[name];\n            defining[name] = true;\n            main.apply(undef, args);\n        }\n\n        if (!hasProp(defined, name) && !hasProp(defining, name)) {\n            throw new Error('No ' + name);\n        }\n        return defined[name];\n    }\n\n    //Turns a plugin!resource to [plugin, resource]\n    //with the plugin being undefined if the name\n    //did not have a plugin prefix.\n    function splitPrefix(name) {\n        var prefix,\n            index = name ? name.indexOf('!') : -1;\n        if (index > -1) {\n            prefix = name.substring(0, index);\n            name = name.substring(index + 1, name.length);\n        }\n        return [prefix, name];\n    }\n\n    /**\n     * Makes a name map, normalizing the name, and using a plugin\n     * for normalization if necessary. Grabs a ref to plugin\n     * too, as an optimization.\n     */\n    makeMap = function (name, relName) {\n        var plugin,\n            parts = splitPrefix(name),\n            prefix = parts[0];\n\n        name = parts[1];\n\n        if (prefix) {\n            prefix = normalize(prefix, relName);\n            plugin = callDep(prefix);\n        }\n\n        //Normalize according\n        if (prefix) {\n            if (plugin && plugin.normalize) {\n                name = plugin.normalize(name, makeNormalize(relName));\n            } else {\n                name = normalize(name, relName);\n            }\n        } else {\n            name = normalize(name, relName);\n            parts = splitPrefix(name);\n            prefix = parts[0];\n            name = parts[1];\n            if (prefix) {\n                plugin = callDep(prefix);\n            }\n        }\n\n        //Using ridiculous property names for space reasons\n        return {\n            f: prefix ? prefix + '!' + name : name, //fullName\n            n: name,\n            pr: prefix,\n            p: plugin\n        };\n    };\n\n    function makeConfig(name) {\n        return function () {\n            return (config && config.config && config.config[name]) || {};\n        };\n    }\n\n    handlers = {\n        require: function (name) {\n            return makeRequire(name);\n        },\n        exports: function (name) {\n            var e = defined[name];\n            if (typeof e !== 'undefined') {\n                return e;\n            } else {\n                return (defined[name] = {});\n            }\n        },\n        module: function (name) {\n            return {\n                id: name,\n                uri: '',\n                exports: defined[name],\n                config: makeConfig(name)\n            };\n        }\n    };\n\n    main = function (name, deps, callback, relName) {\n        var cjsModule, depName, ret, map, i,\n            args = [],\n            callbackType = typeof callback,\n            usingExports;\n\n        //Use name if no relName\n        relName = relName || name;\n\n        //Call the callback to define the module, if necessary.\n        if (callbackType === 'undefined' || callbackType === 'function') {\n            //Pull out the defined dependencies and pass the ordered\n            //values to the callback.\n            //Default to [require, exports, module] if no deps\n            deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;\n            for (i = 0; i < deps.length; i += 1) {\n                map = makeMap(deps[i], relName);\n                depName = map.f;\n\n                //Fast path CommonJS standard dependencies.\n                if (depName === \"require\") {\n                    args[i] = handlers.require(name);\n                } else if (depName === \"exports\") {\n                    //CommonJS module spec 1.1\n                    args[i] = handlers.exports(name);\n                    usingExports = true;\n                } else if (depName === \"module\") {\n                    //CommonJS module spec 1.1\n                    cjsModule = args[i] = handlers.module(name);\n                } else if (hasProp(defined, depName) ||\n                           hasProp(waiting, depName) ||\n                           hasProp(defining, depName)) {\n                    args[i] = callDep(depName);\n                } else if (map.p) {\n                    map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});\n                    args[i] = defined[depName];\n                } else {\n                    throw new Error(name + ' missing ' + depName);\n                }\n            }\n\n            ret = callback ? callback.apply(defined[name], args) : undefined;\n\n            if (name) {\n                //If setting exports via \"module\" is in play,\n                //favor that over return value and exports. After that,\n                //favor a non-undefined return value over exports use.\n                if (cjsModule && cjsModule.exports !== undef &&\n                        cjsModule.exports !== defined[name]) {\n                    defined[name] = cjsModule.exports;\n                } else if (ret !== undef || !usingExports) {\n                    //Use the return value from the function.\n                    defined[name] = ret;\n                }\n            }\n        } else if (name) {\n            //May just be an object definition for the module. Only\n            //worry about defining if have a module name.\n            defined[name] = callback;\n        }\n    };\n\n    requirejs = require = req = function (deps, callback, relName, forceSync, alt) {\n        if (typeof deps === \"string\") {\n            if (handlers[deps]) {\n                //callback in this case is really relName\n                return handlers[deps](callback);\n            }\n            //Just return the module wanted. In this scenario, the\n            //deps arg is the module name, and second arg (if passed)\n            //is just the relName.\n            //Normalize module name, if it contains . or ..\n            return callDep(makeMap(deps, callback).f);\n        } else if (!deps.splice) {\n            //deps is a config object, not an array.\n            config = deps;\n            if (config.deps) {\n                req(config.deps, config.callback);\n            }\n            if (!callback) {\n                return;\n            }\n\n            if (callback.splice) {\n                //callback is an array, which means it is a dependency list.\n                //Adjust args if there are dependencies\n                deps = callback;\n                callback = relName;\n                relName = null;\n            } else {\n                deps = undef;\n            }\n        }\n\n        //Support require(['a'])\n        callback = callback || function () {};\n\n        //If relName is a function, it is an errback handler,\n        //so remove it.\n        if (typeof relName === 'function') {\n            relName = forceSync;\n            forceSync = alt;\n        }\n\n        //Simulate async callback;\n        if (forceSync) {\n            main(undef, deps, callback, relName);\n        } else {\n            //Using a non-zero value because of concern for what old browsers\n            //do, and latest browsers \"upgrade\" to 4 if lower value is used:\n            //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:\n            //If want a value immediately, use require('id') instead -- something\n            //that works in almond on the global level, but not guaranteed and\n            //unlikely to work in other AMD implementations.\n            setTimeout(function () {\n                main(undef, deps, callback, relName);\n            }, 4);\n        }\n\n        return req;\n    };\n\n    /**\n     * Just drops the config on the floor, but returns req in case\n     * the config return value is used.\n     */\n    req.config = function (cfg) {\n        return req(cfg);\n    };\n\n    /**\n     * Expose module registry for debugging and tooling\n     */\n    requirejs._defined = defined;\n\n    define = function (name, deps, callback) {\n        if (typeof name !== 'string') {\n            throw new Error('See almond README: incorrect module build, no module name');\n        }\n\n        //This module may not have dependencies\n        if (!deps.splice) {\n            //deps is not an array, so probably means\n            //an object literal or factory function for\n            //the value. Adjust args.\n            callback = deps;\n            deps = [];\n        }\n\n        if (!hasProp(defined, name) && !hasProp(waiting, name)) {\n            waiting[name] = [name, deps, callback];\n        }\n    };\n\n    define.amd = {\n        jQuery: true\n    };\n}());\n\ndefine(\"../lib/almond\", function(){});\n\n","/*\n * View that is rendered if we have no fields within a cell.\n */\ndefine( 'views/emptyCell',[], function() {\n\tvar view = Marionette.ItemView.extend( {\n\t\ttagname: 'div',\n\t\ttemplate: '#nf-tmpl-empty-cell'\n\t} );\n\n\treturn view;\n} );\n","/**\n * Individual cell view.\n *\n */\ndefine( 'views/cellItem',['views/emptyCell'], function( EmptyCell ) {\n\tvar view = Marionette.CollectionView.extend( {\n\t\ttagname: 'div',\n\t\tclassName: 'layouts-cell',\n\t\temptyView: EmptyCell,\n\t\tdropping: false,\n\n\t\tinitialize: function( options ) {\n\t\t\t// Set our collection to the fields within this cell\n\t\t\tthis.collection = this.model.get( 'fields' );\n\t\t\t// Get our field view from Ninja Forms core.\n\t\t\tthis.childView = nfRadio.channel( 'views' ).request( 'get:fieldItem' );\n\t\t\t// Get the collection to which this cell belongs.\n\t\t\tthis.cellCollection = options.cellCollection;\n\t\t},\n\n\t\t/**\n\t\t * When we render we need to:\n\t\t * 1) Set a data attribute on our cell element representing width.\n\t\t * 2) Set a data attribute on our cell element representing the cell model.\n\t\t * 3) Set classes on our cell element based upon how many fields it contains.\n\t\t * 4) Make our cell sortable droppable if we have more than one cell in the collection.\n\t\t * 5) Init our sortable.\n\t\t * \n\t\t * @since  version\n\t\t * @return {[type]} [description]\n\t\t */\n\t\tonRender: function() {\n\t\t\tjQuery( this.el ).data( 'width', this.model.get( 'width' ) );\n\t\t\tjQuery( this.el ).data( 'model', this.model );\n\t\t\t// Used during troubleshooting to add a class to the cell element.\n\t\t\t// jQuery( this.el ).addClass( this.model.cid );\n\n\t\t\t// if ( 1 < this.cellCollection.length ) {\n\t\t\t\t// jQuery( this.el ).addClass( 'layouts-droppable nf-fields-sortable' );\t\n\t\t\t// } else { // we want a draggable.\n\n\t\t\t// }\n\t\t\t\n\t\t\t// Set a class based upon how many fields are in our cell.\n\t\t\tif ( this.collection.models.length == 1 ) {\n\t\t\t\tjQuery( this.el ).addClass( 'single-field' );\n\t\t\t\tjQuery( this.el ).removeClass( 'multi-field' );\n\t\t\t} else {\n\t\t\t\tjQuery( this.el ).addClass( 'multi-field' );\n\t\t\t\tjQuery( this.el ).removeClass( 'single-field' );\n\t\t\t}\n\n\t\t\t// Make this cell droppable if we have more than one field.\n\t\t\tif ( 1 < this.cellCollection.length ) {\n\t\t\t\tjQuery( this.el ).addClass( 'layouts-droppable' );\t\n\t\t\t\t// If we have multiple cells in this row, make this cell droppable for new fields\n\t\t\t\tjQuery( this.el ).addClass( 'nf-field-type-droppable' );\n\t\t\t} else {\n\t\t\t\tjQuery( this.el ).removeClass( 'nf-field-type-droppable' );\n\t\t\t\tjQuery( this.el ).removeClass( 'layouts-droppable' );\t\n\t\t\t}\n\n\t\t\t// Init our sortable.\n\t\t\tthis.initSortable();\n\t\t},\n\n\t\t/**\n\t\t * Initialize our sortable.\n\t\t * Sends out radio messages when there are sortable events.\n\t\t * \n\t\t * @since  3.0\n\t\t * @return void\n\t\t */\n\t\tinitSortable: function() {\n\t\t\tvar that = this;\n\t\t\tjQuery( this.el ).sortable( {\n\t\t\t\t// Don't let the item controls be used as a handle.\n\t\t\t\tcancel: '.nf-item-controls',\n\t\t\t\t// Class name of our placeholder. Adds the green highlight.\n\t\t\t\tplaceholder: 'nf-fields-sortable-placeholder',\n\t\t\t\t// Opacity of the draggable\n\t\t\t\topacity: 0.95,\n\t\t\t\t// Acceptable items.\n\t\t\t\titems: '.nf-field-wrap, .nf-stage',\n\t\t\t\t// We care about the pointer, not an intersection.\n\t\t\t\ttolerance: 'pointer',\n\t\t\t\t// Allows us to drop items from this sortable into others.\n\t\t\t\tconnectWith: '.layouts-droppable',\n\t\t\t\t// Update droppable areas as we drag. Important because of the \"swell\" effect on the builder.\n\t\t\t\trefreshPositions: true,\n\t\t\t\tappendTo: '#nf-main',\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Return a helper that will be used for the drag event of the sortable.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object e event object\n\t\t\t\t * @return object   drag element\n\t\t\t\t */\n\t\t\t\thelper: function( e ) {\n\t\t\t\t\tvar element = nfRadio.channel( 'layouts' ).request( 'getHelper:cellSortable', e, that, this );\n\t\t\t\t\treturn element;\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * When we hover over our sortable while dragging, send out a radio message.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object e  event object\n\t\t\t\t * @param  object ui jQuery UI object\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\tover: function( e, ui ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'over:cellSortable', e, ui, that, this );\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * When we hover over out of our sortable while dragging, send out a radio message.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object e  event object\n\t\t\t\t * @param  object ui jQuery UI object\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\tout: function( e, ui ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'out:cellSortable', e, ui, that, this );\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * When we sort our sortable while dragging, send out a radio message.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object e  event object\n\t\t\t\t * @param  object ui jQuery UI object\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t        sort: function( e, ui) {\n\t\t        \t     \tnfRadio.channel( 'layouts' ).trigger( 'sort:cellSortable', e, ui, that, this );\n\t\t        },\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * When we receive an item, send out a radio message.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object e  event object\n\t\t\t\t * @param  object ui jQuery UI object\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\treceive: function( e, ui ) {\n\t\t\t\t\tif ( ui.item.dropping ) return;\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'receive:cellSortable', e, ui, that, this );\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * When we start dragging, send out a radio message.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object e  event object\n\t\t\t\t * @param  object ui jQuery UI object\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\tstart: function( e, ui ) {\n\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'start:cellSortable', e, ui, that, this );\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * When we stop dragging, send out a radio message.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object e  event object\n\t\t\t\t * @param  object ui jQuery UI object\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\tstop: function( e, ui ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'stop:cellSortable', e, ui, that, this );\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * When we update our sortable order, send out a radio message.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object e  event object\n\t\t\t\t * @param  object ui jQuery UI object\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\tupdate: function( e, ui ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'update:cellSortable', e, ui, that, this );\n\t\t\t\t}\n\t\t\t} );\n\t\t},\n\n\t\t/**\n\t\t * Template helper functions\n\t\t * \n\t\t * @since  3.0\n\t\t * @return void\n\t\t */\n\t\ttemplateHelpers: function() {\n\t\t\treturn {\n\t\t\t\trenderHandleBefore: function() {\n\t\t\t\t\treturn '<div class=\"layouts-handle\"></div>';\n\t\t\t\t},\n\n\t\t\t\trenderHandleAfter: function() {\n\t\t\t\t\treturn '<div class=\"layouts-handle\"></div>';\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\n\t\t/**\n\t\t * View events\n\t\t * \n\t\t * @type {Object}\n\t\t */\n\t\tevents: {\n\t\t\t'click .delete': 'clickDeleteCell'\n\t\t},\n\n\t\t/**\n\t\t * When the user clicks to delete a cell, remove the model.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  {Object} e event object\n\t\t * @return void\n\t\t */\n\t\tclickDeleteCell: function( e ) {\n\t\t\tnfRadio.channel( 'layouts' ).trigger( 'click:deleteCell', e, this );\n\t\t}\n\t} );\n\n\treturn view;\n} );\n","/**\n * Holds all of our cell field models.\n * \n * @package Ninja Forms Layouts\n * @subpackage Fields\n * @copyright (c) 2016 WP Ninjas\n * @since 3.0\n */\ndefine( 'models/cellFieldCollection',[], function( ) {\n\tvar collection = Backbone.Collection.extend( {\n\t\tcomparator: 'cellOrder',\n\n\t\tinitialize: function( models, options ) {\n\t\t\tthis.options = options;\n\t\t\t\n\t\t\t// Listen to requests to remove a field from a collection.\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts-cell' ), 'remove:field', this.removeField );\n\t\t\t// We've been passed the cellModel to which this collection belongs.\n\t\t\t// this.options.cellModel = options.cellModel;\n\t\t\t_.each( models, function( model ) {\n\t\t\t\tif ( 'undefined' == typeof model ) return;\n\t\t\t\tmodel.set( 'cellcid', this.options.cellModel.cid, { silent: true } );\n\t\t\t}, this );\n\n\t\t\t// When we add or remove a field from this collection, update our cellModel.\n\t\t\tthis.on( 'add', this.addField, this );\n\t\t\tthis.on( 'remove', this.updateCellModel, this );\n\t\t\tvar fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );\n\n\t\t\t// When we remove a model from our main field collection, make sure it's removed from this collection as well.\n\t\t\tfieldCollection.on( 'remove', this.removeModel, this );\n\n\t\t\t// When we add a model to our main field collection, add it to this collection if its cid matches\n\t\t\tfieldCollection.on( 'add', this.addModel, this );\n\n\t\t},\n\n\t\t/**\n\t\t * Add a field to our cell collection\n\t\t * @since 3.0\n\t\t */\n\t\t addField: function( model ) {\n\t\t \tmodel.set( 'cellcid', this.options.cellModel.cid, { silent: true } );\n\t\t \tif ( 1 == this.options.cellModel.collection.length ) {\n\t\t \t\tvar order = this.options.cellModel.collection.options.rowModel.get( 'order' );\n\t\t \t\tthis.remove( model );\n\t\t \t\tnfRadio.channel( 'layouts' ).request( 'add:row', this.options.cellModel.collection.options.rowModel.collection, { order: order, field: model } );\n\t\t \t}\n\t\t \tthis.updateCellModel();\n\t\t },\n\n\n\t\t/**\n\t\t * Update our cellModel.\n\t\t * @since 3.0\n\t\t */\n\t\tupdateCellModel: function() {\n\t\t\tthis.options.cellModel.set( 'fields', this );\n\t\t\tthis.options.cellModel.trigger( 'change:fields', this.options.cellModel );\n\t\t},\n\n\t\t/**\n\t\t * Respond to requests to remove a field from a collection.\n\t\t * @since  3.0\n\t\t * @param  string id field ID\n\t\t * @return void\n\t\t */\n\t\tremoveField: function( id ) {\n\t\t\tif ( this.get( id ) ) {\n\t\t\t\tthis.remove( this.get( id ) );\n\t\t\t}\n\t\t},\n\n\t\tremoveModel: function( model ) {\n\t\t\tthis.remove( model );\n\t\t},\n\n\t\taddModel: function( model ) {\n\t\t\tif ( 'undefined' != typeof this.options.cellModel && this.options.cellModel.cid == model.get( 'cellcid' ) ) {\n\t\t\t\tthis.add( model );\n\t\t\t}\n\t\t}\n\t} );\n\treturn collection;\n} );\n","/**\n * Single row view\n */\ndefine( 'views/rowItem',['views/cellItem', 'models/cellFieldCollection'], function( CellItemView, CellFieldCollection ) {\n\tvar view = Marionette.CollectionView.extend( {\n\t\ttagname: 'div',\n\t\tclassName: 'layouts-row',\n\t\tchildView: CellItemView,\n\t\treorderOnSort: true,\n\n\t\tinitialize: function() {\n\t\t\t// Set our collection to our cells.\n\t\t\tthis.collection = this.model.get( 'cells' );\n\t\t\t/*\n\t\t\t * Set our childViewOptions.\n\t\t\t * As the variable name suggests, this will be accessible within our child views.\n\t\t\t */\n\t\t\tthis.childViewOptions = {\n\t\t\t\tcellCollection: this.collection\n\t\t\t};\n\t\t\t// Respond to requests to update our gutter/divider positions\n\t\t\tnfRadio.channel( 'layouts' ).reply( 'update:gutters', this.updateGutters, this );\n\t\t\t\n\t\t\t/*\n\t\t\t * Bind listeners to row model events.\n\t\t\t */\n\t\t\t// this.model.on( 'destroy:cell', this.render, this );\n\t\t\tthis.collection.on( 'sort', this.render, this );\n\n\t\t\t/*\n\t\t\t * Bind listeners to our nf-builder so that we can track when the user is dragging rather than just mouse over.\n\t\t\t * Because our gutter/divider is a droppable that is very close to a sortable, sometimes the \"drop\" event will fire when we are just mousing over.\n\t\t\t * Tracking that state of the mouse lets us prevent this later.\n\t\t\t * \n\t\t\t */\n\t\t\tjQuery( '#nf-builder' ).on( 'mousedown', function() {\n\t\t\t\tjQuery( this ).data( 'mousedown', true );\n\t\t\t} );\n\t\t\t\n\t\t\tjQuery( '#nf-builder' ).on( 'mouseup', function() {\n\t\t\t\tjQuery( this ).data( 'mousedown', false );\n\t\t\t} );\n\t\t},\n\n\t\t/**\n\t\t * Before we destroy this view, unbind our model change listeners.\n\t\t * If we don't do this, we'll get JS errors.\n\t\t * \n\t\t * @since  3.0\n\t\t * @return void\n\t\t */\n\t\tonBeforeDestroy: function() {\n\t\t\t// this.model.off( 'add:cell', this.render );\n\t\t\t// this.model.off( 'destroy:cell', this.render );\n\t\t\tthis.collection.off( 'sort', this.maybeRender );\n\t\t},\n\n\t\tmaybeRender: function() {\n\t\t\tif ( 1 < this.collection.models.length ) {\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * When we render:\n\t\t * 1) Set our el id to the model cid\n\t\t * 2) Add a class based upon the number of cells in the row\n\t\t * 3) Remove any old gutters\n\t\t * 4) Update our gutters/dividers\n\t\t * 5) Init our gutters/dividers as droppables\n\t\t * \n\t\t * @since  version\n\t\t * @return {[type]} [description]\n\t\t */\n\t\tonRender: function() {\n\t\t\t// Set el ID\n\t\t\tjQuery( this.el ).prop( 'id', this.model.cid );\n\t\t\t// Add class based upon number of cells\n\t\t\tif ( this.collection.models.length == 1 ) {\n\t\t\t\tjQuery( this.el ).addClass( 'single-cell' );\n\t\t\t\tjQuery( this.el ).removeClass( 'multi-cell' );\n\t\t\t} else {\n\t\t\t\tjQuery( this.el ).addClass( 'multi-cell' );\n\t\t\t\tjQuery( this.el ).removeClass( 'single-cell' );\n\t\t\t}\n\t\t\t\n\t\t\t// Remove any gutters. This prevents extra HTML markup from appearing.\n\t\t\tjQuery( this.el ).find( '.gutter' ).remove();\n\t\t\t// Update our gutters/dividers\n\t\t\tthis.updateGutters();\n\t\t\t// We want to access our rowView object later\n\t\t\tvar rowView = this;\n\t\t\t// Init our droppables.\n\t\t\tjQuery( this.el ).find( '.gutter' ).droppable( {\n\t\t\t\t// Activate by pointer\n\t\t\t\ttolerance: 'pointer',\n\t\t\t\t// Class added when we're dragging over\n\t\t\t\thoverClass: 'nf-fields-sortable-placeholder',\n\t\t\t\t// Which elements do we want to accept?\n\t\t\t\taccept: '.nf-field-type-draggable, .nf-field-wrap, .nf-stage',\n\n\t\t\t\t/**\n\t\t\t\t * When we drag over this droppable, trigger a radio event.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object \te  event\n\t\t\t\t * @param  object \tui jQuery UI element\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\tover: function( e, ui ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'over:gutterDroppable', e, ui, rowView, this );\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * When we drag out of this droppable, trigger a radio event.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object \te  event\n\t\t\t\t * @param  object \tui jQuery UI element\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\tout: function( e, ui ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'out:gutterDroppable', e, ui, rowView, this );\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * When we drop on this droppable, trigger a radio event.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object \te  event\n\t\t\t\t * @param  object \tui jQuery UI element\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\tdrop: function( e, ui ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'drop:gutterDroppable', e, ui, rowView, this );\n\t\t\t\t}\n\t\t\t} );\n\t\t},\n\n\t\t/**\n\t\t * Check for gutters in our row and activate them as sliders.\n\t\t * \n\t\t * @since  3.0\n\t\t * @return void\n\t\t */\n\t\tupdateGutters: function() {\n\t\t\t// Get our gutter elements\n\t\t\tvar elements = jQuery( this.el ).find( '.layouts-cell' );\n\t\t\tvar that = this;\n\t\t\t// Call split.js to create resizable cells.\n\t\t\tSplit( elements, {\n\t\t\t\tminSize: 50,\n\t\t\t\tcellCollection: that.collection,\n\t\t\t\t// When we start resizing our cell, trigger a radio event.\n\t\t\t\tonDragStart: function( data ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'dragStart:gutterSlider', data, that.collection );\n\t\t\t\t},\n\t\t\t\t// When we drag/resize our cell, trigger a radio event.\n\t\t\t\tonDrag: function( data ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'drag:gutterSlider', data, that.collection );\n\t\t\t\t},\n\t\t\t\t// When we stop resizing our cell, trigger a radio event.\n\t\t\t\tonDragEnd: function( data ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'dragEnd:gutterSlider', data, that.collection );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// Set the css width on our gutters\n\t\t\t_.each( jQuery( elements ), function( cell, index ) {\n\t\t\t\tvar width = jQuery( cell ).data( 'width' );\n\t\t\t\tvar gutterWidth = 10;\n\t\t\t\tif ( 0 == index || index == jQuery( elements ).length - 1 ) {\n\t\t\t\t\t// gutterWidth = 5;\n\t\t\t\t}\n\t\t\t\tjQuery( cell ).css( 'width', 'calc(' + width + '% - ' + gutterWidth + 'px)' );\n\t\t\t} );\n\n\t\t\t// Add a gutter/divider before our first cell and after our last cell.\n\t\t\tvar html = '<div class=\"gutter\" style=\"width: 10px; cursor: ew-resize;\"></div>';\n\t\t\tjQuery( this.el ).find( '.layouts-cell:first' ).before( html );\n\t\t\tjQuery( this.el ).find( '.layouts-cell:last' ).after( html );\n\t\t}\n\n\t} );\n\n\treturn view;\n} );\n","/**\n * Row collection (sortable) view.\n */\ndefine( 'views/rowCollection',['views/rowItem'], function( RowItemView ) {\n\tvar view = Marionette.CollectionView.extend( {\n\t\ttagname: 'div',\n\t\tclassName: 'layouts-row-collection layouts-droppable nf-field-type-droppable nf-fields-sortable',\n\t\tchildView: RowItemView,\n\t\treorderOnSort: true,\n\n\t\tgetEmptyView: function() {\n\t\t\treturn nfRadio.channel( 'views' ).request( 'get:mainContentEmpty' );\n\t\t},\n\n\t\tinitialize: function() {\n\t\t\tthis.collection.on( 'add', this.maybeInitSortable, this );\n\t\t},\n\n\t\tonBeforeDestroy: function() {\n\t\t\tthis.collection.off( 'add', this.maybeInitSortable );\n\t\t},\n\n\t\t/**\n\t\t * Remove any rows that are completely empty.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  {Backbone.Model} \t\trowModel\n\t\t * @param  {int} index\n\t\t * @param  {Backbone.Collection} \trowCollection [description]\n\t\t * @return {bool}\t\t\t\t\tShould this row be output in the collection view?\n\t\t */\n\t\tfilter: function( rowModel, index, rowCollection ) {\n\t\t\tvar show = false;\n\t\t\t_.each( rowModel.get( 'cells' ).models, function( cell ) {\n\t\t\t\tif ( 0 != cell.get( 'fields' ).length ) {\n\t\t\t\t\tshow = true;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn show;\n\t\t},\n\n\t\t/**\n\t\t * When we render this view, init our rows collection sortable.\n\t\t * \n\t\t * @since  3.0\n\t\t * @return void\n\t\t */\n\t\tonRender: function() {\n\t\t\tthis.maybeInitSortable();\n\t\t},\n\n\t\tmaybeInitSortable: function() {\n\t\t\tif ( 0 < this.collection.models.length ) {\n\t\t\t\tthis.initSortable();\n\t\t\t}\t\t\t\n\t\t},\n\n\t\tinitSortable: function() {\n\t\t\tvar that = this;\n\t\t\t// Init our sortable.\n\t\t\tjQuery( this.el ).sortable( {\n\t\t\t\thelper: 'clone',\n\t\t\t\thandle: '.gutter:first',\n\t\t\t\titems: '.layouts-row',\n\t\t\t\tcancel: '.layouts-cell',\n\t\t\t\ttolerance: 'pointer',\n\t\t\t\tplaceholder: 'nf-fields-sortable-placeholder',\n\t\t\t\tappendTo: '#nf-main',\n\t\t\t\tgrid: [ 5, 5 ],\n\n\t\t\t\t/**\n\t\t\t\t * When we start dragging an item, trigger an event.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object \te  event\n\t\t\t\t * @param  object \tui jQuery UI element\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\tstart: function( e, ui ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'start:rowsSortable', e, ui, that, this );\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * When we stop dragging an item, trigger an event.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object \te  event\n\t\t\t\t * @param  object \tui jQuery UI element\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\tstop: function( e, ui ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'stop:rowsSortable', e, ui, that, this );\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * When we drag an item over our sortable, trigger an event.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object \te  event\n\t\t\t\t * @param  object \tui jQuery UI element\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\tover: function( e, ui ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'over:rowsSortable', e, ui, that, this );\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * When we move an item off of our sortable, trigger an event.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object \te  event\n\t\t\t\t * @param  object \tui jQuery UI element\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\tout: function( e, ui ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'out:rowsSortable', e, ui, that, this );\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * When we drop an item on the sortable, trigger an event.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object \te  event\n\t\t\t\t * @param  object \tui jQuery UI element\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\treceive: function( e, ui ) {\n\t\t\t\t\tif ( ui.item.dropping ) return;\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'receive:rowsSortable', e, ui, that, this );\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * When we drop an item onto our sortable that changes our item order, trigger an event.\n\t\t\t\t * \n\t\t\t\t * @since  3.0\n\t\t\t\t * @param  object \te  event\n\t\t\t\t * @param  object \tui jQuery UI element\n\t\t\t\t * @return void\n\t\t\t\t */\n\t\t\t\tupdate: function( e, ui ) {\n\t\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'update:rowsSortable', e, ui, that, this );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\n\treturn view;\n} );\n","/**\n * Model that holds our cell information\n * \n * @package Ninja Forms Layouts\n * @subpackage Layouts\n * @copyright (c) 2016 WP Ninjas\n * @since 3.0\n */\ndefine( 'models/cellModel',['models/cellFieldCollection'], function( CellFieldCollection) {\n\tvar model = Backbone.Model.extend( {\n\t\tinitialize: function() {\n\t\t\tvar fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );\n\t\t\tvar fieldModels = [];\n\n\t\t\t_.each( this.get( 'fields' ), function( search ) {\n\t\t\t\tif ( 'undefined' == typeof fieldCollection.get( search ) ) {\n\t\t\t\t\tvar findField = fieldCollection.findWhere( { key: search } );\n\t\t\t\t\tif ( 'undefined' != typeof findField ) {\n\t\t\t\t\t\tfieldModels.push( findField );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfieldModels.push( fieldCollection.get( search ) );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tif ( false === this.get( 'fields' ) instanceof Backbone.Collection ) {\n\t\t\t\tthis.set( 'fields', new CellFieldCollection( fieldModels, { cellModel: this } ) );\n\t\t\t}\n            this.set( 'order', Number( this.get( 'order' ) ) );\n\t\t}\n\t\t\n\t} );\n\t\n\treturn model;\n} );\n","/**\n * Holds all of our cell models.\n * \n * @package Ninja Forms Layouts\n * @subpackage Fields\n * @copyright (c) 2016 WP Ninjas\n * @since 3.0\n */\ndefine( 'models/cellCollection',['models/cellModel'], function( cellModel ) {\n\tvar collection = Backbone.Collection.extend( {\n\t\tmodel: cellModel,\n\t\tcomparator: 'order',\n\n\t\tinitialize: function( models, options ) {\n\t\t\tthis.options = options;\n\t\t\tthis.on( 'change:fields', this.updateRowModel, this );\n\t\t\tthis.on( 'add', this.addCell, this );\n\t\t\tthis.on( 'remove', this.updateCellWidths, this );\n\t\t},\n\n\t\taddCell: function() {\n\t\t\tthis.updateCellWidths();\n\t\t\tthis.updateRowModel();\n\t\t\tthis.options.rowModel.trigger( 'add:cell', this.options.rowModel );\n\t\t},\n\n\t\tupdateRowModel: function() {\n\t\t\tthis.options.rowModel.set( 'cells', this );\n\t\t\tthis.options.rowModel.trigger( 'change:cells', this.options.rowModel );\n\t\t},\n\n\t\t/**\n\t\t * Update our cell widths.\n\t\t * This is called whenever we add or remove a cell from our cell collection.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  Backbone.Model \tcellModel\n\t\t * @return void\n\t\t */\n\t\tupdateCellWidths: function( cellModel ) {\n\t\t\t// Calculate a new width for our cells.\n\t\t\tvar width = Math.round( 100 / this.models.length );\n\n\t\t\tif ( 100 < width * this.models.length ) {\n\t\t\t\twidth = Math.floor( 100 / this.models.length );\n\t\t\t}\n\n\t\t\t// Set our width for each cell.\n\t\t\t_.each( this.models, function( cell ) {\n\t\t\t\tcell.set( 'width', width );\n\t\t\t} );\n\n\t\t\tthis.sort();\n\t\t}\n\t} );\n\treturn collection;\n} );\n","/**\n * Model that holds our row information\n * \n * @package Ninja Forms Layouts\n * @subpackage Fields\n * @copyright (c) 2016 WP Ninjas\n * @since 3.0\n */\ndefine( 'models/rowModel',['models/cellCollection'], function( CellCollection ) {\n\tvar model = Backbone.Model.extend( {\n\n\t\tinitialize: function( models, options ) {\n\t\t\tthis.options = options;\n\t\t\tthis.set( 'cells', new CellCollection( this.get( 'cells' ), { rowModel: this } ) );\n\t\t\tthis.on( 'change:cells', this.checkEmptyCells, this );\n            this.set( 'order', Number( this.get( 'order' ) ) );\n\t\t},\n\n\t\tcheckEmptyCells: function( model ) {\n\t\t\t/*\n\t\t\t * Check to see if all our cells are empty. If they are, self destruct.\n\t\t\t */\n\t\t\tvar remove = true;\n\t\t\t_.each( this.get( 'cells' ).models, function( cell ) {\n\t\t\t\tif ( 0 != cell.get( 'fields' ).length ) {\n\t\t\t\t\tremove = false;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tif ( remove && 'undefined' != typeof this.collection ) {\n\t\t\t\tthis.collection.remove( this );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\t\t\n\t} );\n\t\n\treturn model;\n} );\n","/**\n * Holds all of our row models.\n * \n * @package Ninja Forms Layouts\n * @subpackage Fields\n * @copyright (c) 2016 WP Ninjas\n * @since 3.0\n */\ndefine( 'models/rowCollection',['models/rowModel'], function( rowModel ) {\n\tvar collection = Backbone.Collection.extend( {\n\t\tmodel: rowModel,\n\t\tcomparator: 'order',\n\n\t\tinitialize: function( models ) {\n\t\t\tthis.updateMaxCols( models );\n\t\t\tthis.on( 'add:cell', this.updateMaxCols, this );\n\t\t\tthis.on( 'destroy:cell', this.updateMaxCols, this );\n\t\t\tthis.on( 'remove:cell', this.updateMaxCols, this );\n\t\t\tthis.on( 'destroy', this.updateMaxCols, this );\n\t\t\t\n\t\t\tthis.on( 'add:field', this.addField, this );\n\t\t\tthis.on( 'append:field', this.appendField, this );\n\t\t\tthis.on( 'remove:field', this.removeField, this );\n\t\t},\n\n\t\tupdateMaxCols: function( models ) {\n\t\t\tvar maxCols = 1;\n\t\t\tif ( true === models instanceof Backbone.Model ) {\n\t\t\t\tmodels = this.models\n\t\t\t}\n\t\t\t_.each( models, function( row ) {\n\t\t\t\tif ( 'undefined' != typeof row.cells ) {\n\t\t\t\t\tif ( maxCols < row.cells.length ) {\n\t\t\t\t\t\tmaxCols = row.cells.length;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t} else if ( true === row instanceof Backbone.Model ) {\n\t\t\t\t\tif ( maxCols < row.get( 'cells' ).length ) {\n\t\t\t\t\t\tmaxCols = row.get( 'cells' ).length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t} );\n\n\t\t\tnfRadio.channel( 'layouts' ).request( 'update:colClass', maxCols );\n\t\t},\n\n\t\taddField: function( fieldModel ) {\n\t\t\tif ( ! fieldModel.get( 'oldCellcid' ) ) {\n\t\t\t\tthis.appendField( fieldModel );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar cellModel = false;\n\t\t\tthis.every( function( rowModel ) {\n\t\t\t\tif ( rowModel.get( 'cells' ).get( { cid: fieldModel.get( 'oldCellcid' ) } ) ) {\n\t\t\t\t\tcellModel = rowModel.get( 'cells' ).get( { cid: fieldModel.get( 'oldCellcid' ) } );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} );\n\n\t\t\tif ( cellModel ) {\n\t\t\t\tcellModel.get( 'fields' ).add( fieldModel );\n\t\t\t\tcellModel.collection.sort();\n\t\t\t} else {\n\t\t\t\tthis.appendField( fieldModel );\n\t\t\t}\n\n\t\t\tfieldModel.set( 'oldCellcid', false );\n\t\t},\n\n\t\tremoveField: function( fieldModel ) {\n\t\t\tif ( ! fieldModel.get( 'oldCellcid' ) ) {\n\t\t\t\tfieldModel.set( 'oldCellcid', fieldModel.get( 'cellcid' ) );\n\t\t\t}\n\t\t\tnfRadio.channel( 'layouts-cell' ).trigger( 'remove:field', fieldModel.get( 'id' ) );\n\t\t},\n\n\t\tappendField: function( fieldModel ) {\n\t\t\tnfRadio.channel( 'layouts' ).request( 'add:row', this, { field: fieldModel.get( 'key' ) } );\n\t\t}\n\t} );\n\treturn collection;\n} );\n","define( 'controllers/data',[ 'models/rowCollection' ], function( RowCollection ) {\n\tvar controller = Marionette.Object.extend( {\n\t\toverSortable: false,\n\t\toutFired: false,\n\t\toverCell: false,\n\t\toverRows: false,\n\n\t\tinitialize: function() {\n\t\t\t// Respond to requests to add a row to our collection.\n\t\t\tnfRadio.channel( 'layouts' ).reply( 'add:row', this.addRow, this );\n\t\t},\n\n\t\taddRow: function( rowCollection, data ) {\n\n\t\t\tif ( ! rowCollection ) {\n\t\t\t\t/*\n\t\t\t\t * In the RC for Ninja Forms, 'formContentData' was 'fieldContentsData'.\n\t\t\t\t * In 3.0, we changed it to 'formContentData', so this line checks for that old setting name if the new one doesn't exist.\n\t\t\t\t * This is for backwards compatibility and can be removed in the future.\n\t\t\t\t *\n\t\t\t\t * TODO: Remove the || portion of this ternary.\n\t\t\t\t */\n\t\t\t\trowCollection = nfRadio.channel( 'settings' ).request( 'get:setting', 'formContentData' ) || nfRadio.channel( 'settings' ).request( 'get:setting', 'fieldContentsData' );\n\t\t\t\tif ( false === rowCollection instanceof RowCollection ) return false;\n\t\t\t}\n\n\t\t\tif ( 'undefined' == typeof data.order || null == data.order ) {\n\t\t\t\t/*\n\t\t\t\t * Get the order of the last item in our row collection.\n\t\t\t\t */\n\t\t\t\trowOrder = rowCollection.pluck( 'order' );\n\t\t\t\tdata.order = ( 0 < rowOrder.length ) ? _.max( rowOrder ) + 1 : 1;\n\t\t\t}\n\n\t\t\tvar rowModel = rowCollection.add( {\n\t\t\t\torder: data.order,\n\t\t\t\tcells: [\n\t\t\t\t\t{\n\t\t\t\t\t\torder: 0,\n\t\t\t\t\t\tfields: [ data.field ],\n\t\t\t\t\t\twidth: '100'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t} );\n\n\t\t\treturn rowModel;\n\t\t},\n\n\t\tupdateOverSortable: function( val ) {\n\t\t\tthis.overSortable = val;\n\t\t},\n\n\t\tgetOverSortable: function() {\n\t\t\treturn this.overSortable;\n\t\t},\n\n\t\tupdateOutFired: function( val ) {\n\t\t\tthis.outFired = val;\n\t\t},\n\n\t\tgetOutFired: function() {\n\t\t\treturn this.outFired;\n\t\t},\n\n\t\tupdateOverCell: function( val ) {\n\t\t\tthis.overCell = val;\n\t\t},\n\n\t\tgetOverCell: function() {\n\t\t\treturn this.overCell;\n\t\t}\n\t});\n\n\treturn controller;\n} );\n","define( 'controllers/maxCols',[], function() {\n\tvar controller = Marionette.Object.extend( {\n\t\tinitialize: function() {\n\t\t\tnfRadio.channel( 'layouts' ).reply( 'update:colClass', this.updateColClass );\n\t\t},\n\n\t\tupdateColClass: function( num ) {\n\t\t\tvar builderEl = nfRadio.channel( 'app' ).request( 'get:builderEl' );\n\t\t\tjQuery( builderEl ).removeClass( 'few several many' );\n\n\t\t\tif ( num == 3 ) {\n\t\t\t\tvar builderClass = 'few';\n\t\t\t} else if ( num >= 4 && num <= 5 ) {\n\t\t\t\tvar builderClass = 'several';\n\t\t\t} else if ( num >= 6 ) {\n\t\t\t\tvar builderClass = 'many';\n\t\t\t} else {\n\t\t\t\tvar builderClass = '';\n\t\t\t}\n\n\t\t\tjQuery( builderEl ).addClass( builderClass );\n\n\t\t}\n\n\t});\n\n\treturn controller;\n} );\n\n","define( 'controllers/addField',[], function() {\n\tvar controller = Marionette.Object.extend( {\n\t\tinitialize: function() {\n\t\t\tvar fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );\n\t\t\tfieldCollection.on( 'add', this.maybeAddRow, this );\n\n\t\t\tthis.listenTo( nfRadio.channel( 'drawer-addField' ), 'startDrag:type', this.startDragging );\n\t\t\tthis.listenTo( nfRadio.channel( 'drawer-addField' ), 'stopDrag:type', this.stopDragging );\n\n\t\t\tthis.listenTo( nfRadio.channel( 'drawer-addField' ), 'startDrag:fieldStaging', this.startDragging );\n\t\t\tthis.listenTo( nfRadio.channel( 'drawer-addField' ), 'stopDrag:fieldStaging', this.stopDragging );\n\t\t},\n\n\t\tmaybeAddRow: function( model ) {\n            if ( ! model.get( 'cellcid' ) ) {\n\t\t\t\tvar order = ( ! model.get( 'order' ) || 999 == model.get( 'order' ) ) ? null : model.get( 'order' );\n\t\t\t\tnfRadio.channel( 'layouts' ).request( 'add:row', null, { order: order, field: model } );\n\t\t\t}\n\t\t},\n\n\t\tstartDragging: function( ui ) {\n\t\t\tjQuery( '.layouts-row' ).addClass( 'dragging' );\n\t\t\tjQuery( '#nf-builder' ).addClass( 'layouts-dragging' );\n\t\t},\n\n\t\tstopDragging: function( ui ) {\n\t\t\tjQuery( '.layouts-row' ).removeClass( 'dragging' );\n\t\t\tjQuery( '#nf-builder' ).removeClass( 'layouts-dragging' );\n\t\t}\n\n\t});\n\n\treturn controller;\n} );\n\n","/**\n * Controller that handles our cell sortable events.\n */\ndefine( 'controllers/cellSortable',[], function() {\n\tvar controller = Marionette.Object.extend( {\n\t\t// By default, we aren't dropping on a gutter/divider\n\t\tdropping: false,\n\t\treceived: false,\n\n\t\tinitialize: function() {\n\t\t\t/*\n\t\t\t * Respond to requests for our sortable drag helper.\n\t\t\t */\n\t\t\tnfRadio.channel( 'layouts' ).reply( 'getHelper:cellSortable', this.getHelper, this );\n\t\t\t\n\t\t\t/*\n\t\t\t * Listen to events triggered by our cell sortables.\n\t\t\t */\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'over:cellSortable', this.over );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'out:cellSortable', this.out );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'sort:cellSortable', this.sort );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'start:cellSortable', this.start );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'stop:cellSortable', this.stop );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'update:cellSortable', this.update );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'receive:cellSortable', this.receive );\n\t\t\t\n\t\t\t/*\n\t\t\t * Listen to triggers that we're dragging a new field type.\n\t\t\t */\n\t\t\tthis.listenTo( nfRadio.channel( 'drawer-addField' ), 'drag:type', this.dragFieldType );\n\t\t\n\t\t\t/*\n\t\t\t * Listen to requests to set dropping state.\n\t\t\t */ \n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'set:dropping', this.setDropping );\n\t\t\n\t\t\t/*\n\t\t\t * Listen to triggers that we're deleting a cell\n\t\t\t */\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'click:deleteCell', this.deleteCell );\n\t\t},\n\n\t\t/**\n\t\t * When we are over a cell sortable, we need to:\n\t\t *\n\t\t * 1) Change the width of the helper to match the sortable\n\t\t * 2) If a gutter has a placholder class, remove it so that we don't have multiple placeholders\n\t\t * 3) If we only have one cell and one field, remove any placeholders in this row.\n\t\t * 4) Trigger the Ninja Forms default handler for being over a field sortable.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object e        event\n\t\t * @param  object ui       ui object\n\t\t * @param  object cellView Backbone view\n\t\t * @param  object sortable jQuery UI element\n\t\t * @return void\n\t\t */\n\t\tover: function( e, ui, cellView, sortable ) {\n\t\t\t// Change the size of our dragged element.\n\t\t\tjQuery( ui.helper ).css( 'width', jQuery( sortable ).css( 'width' ) );\n\t\t\t// If we have a gutter with a placeholder class, remove it and add a temporary placeholder.\n\t\t\tjQuery( '#nf-main' ).find( '.gutter.nf-fields-sortable-placeholder' ).removeClass( 'nf-fields-sortable-placeholder' );\n\t\t\t// If we only have one cell and one field, remove any placeholders in this row.\n\t\t\tif ( cellView.collection.models.length == 1 && 1 == cellView.cellCollection.length ) {\n\t\t\t\tjQuery( sortable ).parent().find( '.nf-fields-sortable-placeholder' ).addClass( 'nf-placeholder-removed' ).removeClass( 'nf-fields-sortable-placeholder' );\n\t\t\t\tjQuery( sortable ).parent().find( '.nf-placeholder-removed' ).prev().css( 'margin-bottom', '0' );\n\t\t\t}\n\t\t\t// Trigger Ninja Forms default handler for being over a field sortable.\n\t\t\tnfRadio.channel( 'app' ).request( 'over:fieldsSortable', ui );\n\t\t},\n\n\t\t/**\n\t\t * When we move out from a cell sortable, we need to:\n\t\t *\n\t\t * 1) Trigger the default Ninja Forms handler for mouse out of a sortable.\n\t\t * 2) Add the placeholder class back to any we removed in the over method.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object e        event\n\t\t * @param  object ui       ui object\n\t\t * @param  object cellView Backbone view\n\t\t * @param  object sortable jQuery UI element\n\t\t * @return void\n\t\t */\n\t\tout: function( e, ui, cellView, sortable ) {\n\t\t\tnfRadio.channel( 'app' ).request( 'out:fieldsSortable', ui );\n\t\t\tif ( cellView.collection.models.length == 1 && 1 == cellView.cellCollection.length ) {\n\t\t\t\tjQuery( sortable ).parent().find( '.nf-placeholder-removed' ).prev().css( 'margin-bottom', '' );\n\t\t\t\tjQuery( sortable ).parent().find( '.nf-placeholder-removed' ).addClass( 'nf-fields-sortable-placeholder' ).removeClass( 'nf-placeholder-removed' );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The contents of this method have been commented out because I'm not sure that we need them anymore.\n\t\t * This was a fix for a bug that occurred when dragging the staging area. The placeholder would jump\n\t\t * out of the target sortable and off-screen. This seems to be fixed in the current version, but I'm leaving\n\t\t * this code incase we need to reference it again. It wasn't easy to find.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object e        event\n\t\t * @param  object ui       ui object\n\t\t * @param  object cellView Backbone view\n\t\t * @param  object sortable jQuery UI element\n\t\t * @return void\n\t\t */\n\t\tsort: function( e, ui, cellView, sortable ) {\n\t\t\t// if ( 0 == ui.placeholder.position().left ) {\n        \t\t // jQuery( ui.item ).before( ui.placeholder );\n        \t// }\n\t\t},\n\n\t\t/**\n\t\t * When we start dragging the sortable items:\n\t\t * 1) Set the fieldCollection property to the cellView collection\n\t\t * 2) Add a dragging class to our layouts row\n\t\t * 3) Add a dragging class to our builder\n\t\t * 4) Trigger our Ninja Forms default start for fields sortable.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object e        event\n\t\t * @param  object ui       ui object\n\t\t * @param  object cellView Backbone view\n\t\t * @param  object sortable jQuery UI element\n\t\t * @return void\n\t\t */\n\t\tstart: function( e, ui, cellView, sortable ) {\n\t\t\tui.item.fieldCollection = cellView.collection;\n\t\t\tjQuery( '.layouts-row' ).addClass( 'dragging' );\n\t\t\tjQuery( '#nf-builder' ).addClass( 'layouts-dragging' );\n\t\t\tnfRadio.channel( 'app' ).request( 'start:fieldsSortable', ui );\n\t\t\tif ( this.dropping ) {\n\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'set:dropping', false );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * When we stop dragging the sortable items:\n\t\t * 1) Remove our dragging classes\n\t\t * 2) Trigger our Ninja Forms default stop for fields sortable.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object e        event\n\t\t * @param  object ui       ui object\n\t\t * @param  object cellView Backbone view\n\t\t * @param  object sortable jQuery UI element\n\t\t * @return void\n\t\t */\n\t\tstop: function( e, ui, cellView, sortable ) {\n\t\t\tjQuery( '.layouts-row' ).removeClass( 'dragging' );\n\t\t\tjQuery( '#nf-builder' ).removeClass( 'layouts-dragging' );\n\t\t\tnfRadio.channel( 'app' ).request( 'stop:fieldsSortable', ui );\n\t\t},\n\n\t\t/**\n\t\t * When we update, check to make sure that we are dragging a sortable item and not a new field type.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object e        event\n\t\t * @param  object ui       ui object\n\t\t * @param  object cellView Backbone view\n\t\t * @param  object sortable jQuery UI element\n\t\t * @return void\n\t\t */\n\t\tupdate: function( e, ui, cellView, sortable ) {\n\t\t\t/*\n\t\t\t * Both the receive event above and the update event are fired when we drag items from one list to another.\n\t\t\t * We only want to fire this event if we are dragging within the same list.\n\t\t\t *\n\t\t\t * Also, if we're dragging a saved field, make sure that receive is triggered.\n\t\t\t */\n\t\t\tvar fieldID = jQuery( ui.item ).data( 'id' );\n\t\t\tvar type = nfRadio.channel( 'fields' ).request( 'get:type', fieldID );\n\n\t\t\tif ( 'undefined' !== typeof type && ! this.received ) {\n\t\t\t\tthis.receive( e, ui, cellView, sortable );\n\t\t\t\tthis.received = false;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( sortable === ui.item.parent()[0] && 'undefined' == typeof type ) { // Make sure that we are dragging within the same list\n\t\t\t\tvar fieldModel = nfRadio.channel( 'fields' ).request( 'get:field', fieldID );\n\n\t\t\t\t// Get our sortable order.\n\t\t\t\tvar order = jQuery( sortable ).sortable( 'toArray' );\n\t\t\t\tvar oldOrder = [];\n\t\t\t\t/*\n\t\t\t\t * We have to update every model's order based upon our order array.\n\t\t\t\t * Loop through all of our fields and update their order value\n\t\t\t\t */\n\t\t\t\t_.each( cellView.collection.models, function( field ) {\n\t\t\t\t\tvar id = field.get( 'id' );\n\t\t\t\t\tif ( jQuery.isNumeric( id ) ) {\n\t\t\t\t\t\tvar search = 'field-' + id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar search = id;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Get the index of our field inside our order array\n\t\t\t\t\tvar newPos = order.indexOf( search ) + 1;\n\t\t\t\t\toldOrder[ field.get( 'cellOrder' ) ] = field.get( 'id' );\n\t\t\t\t\tfield.set( 'cellOrder', newPos );\n\t\t\t\t} );\n\t\t\t\t// Sort our field collection.\n\t\t\t\tcellView.collection.sort();\n\n\t\t\t\t// Update our field order attribute\n\t\t\t\tnfRadio.channel( 'layouts' ).request( 'update:fieldOrder', cellView.options.cellCollection.options.rowModel.collection );\n\n\t\t\t\t// Set our 'clean' status to false so that we get a notice to publish changes\n\t\t\t\tnfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );\n\t\t\t\t// Update our preview\n\t\t\t\tnfRadio.channel( 'app' ).request( 'update:db' );\n\t\t\t}\n\t\t\tthis.received = false;\n\t\t},\n\n\t\t/**\n\t\t * The 'receive' event fires whenever we drop a new field type, the staging area, or a field from another cell.\n\t\t * We need to react to each of these events differently.\n\t\t *\n\t\t * If we drop a new field type:\n\t\t * 1) Add the field to the Ninja Forms field collection.\n\t\t * 2) Add the field to our collection.\n\t\t * 3) Sort our fields.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object e        event\n\t\t * @param  object ui       ui object\n\t\t * @param  object cellView Backbone view\n\t\t * @param  object sortable jQuery UI element\n\t\t * @return void\n\t\t */\n\t\treceive: function( e, ui, cellView, sortable ) {\n\t\t\t/*\n\t\t\t * If we are dropping on a gutter, the this.dropping will be set to true.\n\t\t\t * Once we know we've dropped, reset dropping to false.\n\t\t\t * We only want to receive if we didn't drop on a gutter/divider.\n\t\t\t */\n\t\t\tif ( this.dropping ) {\n\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'set:dropping', false );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) ) { // New Field Type Draggable\n\t\t\t\tthis.receiveNewField( e, ui, cellView, sortable );\n\t\t\t} else if ( jQuery( ui.item ).hasClass( 'nf-field-wrap' ) ) { // An item from another cell sortable.\n\t\t\t\tthis.receiveCurrentField( e, ui, cellView, sortable );\n\t\t\t} else { // Staging\n\t\t\t\tthis.receiveFieldStaging( e, ui, cellView, sortable );\t\t\t\t\t\t\n\t\t\t}\n\t\t\t// Update our field order attribute\n\t\t\tnfRadio.channel( 'layouts' ).request( 'update:fieldOrder', cellView.options.cellCollection.options.rowModel.collection );\n\t\t\t// Set our 'clean' status to false so that we get a notice to publish changes\n\t\t\tnfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );\n\t\t\t// Update our preview\n\t\t\tnfRadio.channel( 'app' ).request( 'update:db' );\n\n\t\t\tthis.received = true;\t\t\n\t\t},\n\n\t\t/**\n\t\t * Fires when we drag a new field type into our cell sortable.\n\t\t * 1) Adds a new field model\n\t\t * 2) Sorts our field collection\n\t\t * 3) Removes the helper\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object e        event\n\t\t * @param  object ui       ui object\n\t\t * @param  object cellView Backbone view\n\t\t * @param  object sortable jQuery UI element\n\t\t * @return void\n\t\t */\n\t\treceiveNewField: function( e, ui, cellView, sortable ) {\n\t\t\t// Get our type string\n\t\t\tvar type = jQuery( ui.item ).data( 'id' );\n\t\t\t/*\n\t\t\t * Add a field.\n\t\t\t * Passing the cid of our current cell model causes the field to be added to our cell.\n\t\t\t */ \n\t\t\tvar newModel = this.addField( type, cellView.model.cid );\n\t\t\t/*\n\t\t\t * Update our helper id to the tmpID.\n\t\t\t * We do this so that when we sort, we have the proper ID.\n\t\t\t */ \n\t\t\tjQuery( ui.helper ).prop( 'id', newModel.get( 'id' ) );\n\t\t\tvar order = jQuery( sortable ).sortable( 'toArray' );\n\t\t\t// Sort our field collection\n\t\t\tthis.sortFields( order, cellView.model.get( 'fields' ) );\n\t\t\t// Trigger a drop field type event.\n\t\t\tnfRadio.channel( 'fields' ).trigger( 'drop:fieldType', type, newModel );\n\t\t\t// Remove the helper. Gets rid of a weird type artifact.\n\t\t\tjQuery( ui.helper ).remove();\n\t\t\tif ( null === ui.helper ) {\n\t\t\t\tjQuery( ui.item ).remove();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Fires when we drag the staging area into our cell sortable.\n\t\t * 1) Gets our staging field types\n\t\t * 2) Adds a new field for each of those types\n\t\t * 3) Sort our fields\n\t\t * 4) Remove the helper \n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object e        event\n\t\t * @param  object ui       ui object\n\t\t * @param  object cellView Backbone view\n\t\t * @param  object sortable jQuery UI element\n\t\t * @return void\n\t\t */\n\t\treceiveFieldStaging: function( e, ui, cellView, sortable ) {\n\t\t\t// Make sure that our staged fields are sorted properly.\t\n\t\t\tnfRadio.channel( 'fields' ).request( 'sort:staging' );\n\t\t\t// Grab our staged fields.\n\t\t\tvar stagedFields = nfRadio.channel( 'fields' ).request( 'get:staging' );\n\n\t\t\t// If we're dealing with a sortable that isn't empty, get the order.\n\t\t\tvar order = jQuery( sortable ).sortable( 'toArray' );\n\t\t\t// Get the index of our droped element.\n\t\t\tvar insertedAt = order.indexOf( 'nf-staged-fields-drag' );\n\t\t\t// Remove our dropped element from our order array.\n\t\t\torder.splice( insertedAt, 1 );\n\n\t\t\t// Loop through each staged fields model and insert a field.\n\t\t\tvar tmpIDs = [];\n\t\t\t_.each( stagedFields.models, function( field, index ) {\n\t\t\t\t/*\n\t\t\t\t * Add a field.\n\t\t\t\t * Passing the cid of our current cell model causes the field to be added to our cell.\n\t\t\t\t */\n\t\t\t\tvar newModel = this.addField( field.get( 'slug' ), cellView.model.cid );\n\t\t\t\t// Add this newly created field to our order array.\n\t\t\t\torder.splice( insertedAt + index, 0, newModel.get( 'id' ) );\n\t\t\t}, this );\n\n\t\t\tthis.sortFields( order, cellView.model.get( 'fields' ) );\n\t\t\t// Clear our staging\n\t\t\tnfRadio.channel( 'fields' ).request( 'clear:staging' );\n\t\t\t// Remove our helper. Fixes a weird artifact.\n\t\t\tjQuery( ui.helper ).remove();\n\n\t\t\t/**\n\t\t\t * TODO: Add in support for undoing adding staged fields.\n\t\t\t */\n\t\t\t\n\t\t},\n\n\t\t/**\n\t\t * Fires when we drag a field from another cell into our cell sortable.\n\t\t * 1) Adds the field model to our cell collection\n\t\t * 2) Sort our fields\n\t\t * 3) Remove the field from the original cell\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object e        event\n\t\t * @param  object ui       ui object\n\t\t * @param  object cellView Backbone view\n\t\t * @param  object sortable jQuery UI element\n\t\t * @return void\n\t\t */\n\t\treceiveCurrentField: function( e, ui, cellView, sortable ) {\n\t\t\t/*\n\t\t\t * When we receive an item add it to our collection\n\t\t\t */\n\t\t\tvar fieldID = jQuery( ui.item ).data( 'id' );\n\t\t\tvar fieldModel = nfRadio.channel( 'fields' ).request( 'get:field', fieldID );\n\n\t\t\t/*\n\t\t\t * Get the old order of our sending cell\n\t\t\t */\n\t\t\tvar senderOldOrder = [];\n\t\t\t_.each( ui.item.fieldCollection.models, function( field, index ) {\n\t\t\t\tsenderOldOrder[ field.get( 'cellOrder' ) ] = field.get( 'id' );\n\t\t\t\t// senderOldOrder.push( fieldModel.get( 'cellOrder' ) );\n\t\t\t} );\n\n\t\t\t/*\n\t\t\t * Get the old order of our receiving cell\n\t\t\t */\n\t\t\tvar receiverOldOrder = [];\n\t\t\t_.each( cellView.collection.models, function( field, index ) {\n\t\t\t\treceiverOldOrder[ field.get( 'cellOrder' ) ] = field.get( 'id' );\n\t\t\t\t// receiverOldOrder.push( fieldModel.get( 'cellOrder' ) );\n\t\t\t} );\n\n\t\t\tcellView.collection.add( fieldModel, { silent: true } );\n\n\t\t\tvar order = jQuery( sortable ).sortable( 'toArray' );\n\t\t\tthis.sortFields( order, cellView.collection );\n\n\t\t\tui.item.fieldCollection.remove( fieldModel );\n\t\t},\n\n\t\t/**\n\t\t * Sort a fields collection by order.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object order        \t\tarray\n\t\t * @param  object collection       \tBackbone collection\n\t\t * @return void\n\t\t */\n\t\tsortFields: function( order, collection ) {\n\t\t\t/*\n\t\t\t * Loop through our collection and update our order.\n\t\t\t */\n\t\t\t_.each( collection.models, function( field ) {\n\t\t\t\t// Get our current position.\n\t\t\t\tvar oldPos = field.get( 'cellOrder' );\n\t\t\t\tvar id = field.get( 'id' );\n\t\t\t\tif ( jQuery.isNumeric( id ) ) {\n\t\t\t\t\tvar search = 'field-' + id;\n\t\t\t\t} else {\n\t\t\t\t\tvar search = id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Get the index of our field inside our order array\n\t\t\t\tvar newPos = order.indexOf( search ) + 1;\n\t\t\t\tfield.set( 'cellOrder', newPos );\n\t\t\t} );\n\t\t\t// Sort our field collection.\n\t\t\tcollection.sort();\n\t\t},\n\n\t\t/**\n\t\t * Returns the sortable drag helper.\n\t\t * Places the cursor at the top/left of the draggable.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object e        event\n\t\t * @param  object cellView Backbone view\n\t\t * @param  object sortable jQuery UI element\n\t\t * @return void\n\t\t */\n\t\tgetHelper: function( e, cellView, sortable ) {\n\t\t\tif ( jQuery( e.target ).hasClass( 'nf-field-label' ) || jQuery( e.target ).hasClass( 'fa' ) ) {\n\t\t\t\tvar el = jQuery( e.target ).parent();\n\t\t\t} else if ( jQuery( e.target ).hasClass( 'required' ) ) {\n\t\t\t\tvar el = jQuery( e.target ).parent().parent();\n\t\t\t} else {\n\t\t\t\tvar el = e.target;\n\t\t\t}\n\t\t\tvar width = jQuery( el ).width();\n\t\t\tvar height = jQuery( el ).height();\n\t\t\tvar element = jQuery( el ).clone();\n\t\t\tvar left = width / 4;\n\t\t\tvar top = height / 2;\n\t\t\tjQuery( sortable ).sortable( 'option', 'cursorAt', { top: top, left: left } );\n\t\t\treturn element;\n\t\t},\n\n\t\t/**\n\t\t * Add a field.\n\t\t * Builds the object necessary to add a field to the field model collection.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  string \ttype   field type\n\t\t * @param  boolean \tsilent add silently\n\t\t * @return model \tnewModel\n\t\t */\n\t\taddField: function( type, cellcid, silent ) {\n\t\t\t// Default to false\n\t\t\tsilent = silent || false;\n\t\t\t// Get our field type model\n\t\t\tvar fieldType = nfRadio.channel( 'fields' ).request( 'get:type', type ); \n\t\t\t// Get our tmp ID\n\t\t\tvar tmpID = nfRadio.channel( 'fields' ).request( 'get:tmpID' );\n\t\t\t// Add our field\n\t\t\tvar newModel = nfRadio.channel( 'fields' ).request( 'add',  { id: tmpID, label: fieldType.get( 'nicename' ), type: type, cellcid: cellcid }, silent, false );\n\n\t\t\treturn newModel;\n\t\t},\n\n\t\t/**\n\t\t * When we drag our new field type, make sure that its width stays consistent.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object draggable jQuery UI Object\n\t\t * @param  object ui        jQuery UI Object\n\t\t * @param  object e         event object\n\t\t * @return void\n\t\t */\n\t\tdragFieldType: function( draggable, ui, e ) {\n\t\t\tif ( ui.helper.hasClass( 'nf-field-type-button' ) ) {\n\t\t\t\tvar draggableInstance = jQuery( draggable ).draggable( 'instance' );\n\t\t\t\tjQuery( ui.helper ).css( 'width', draggableInstance.helperProportions.width );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Listens for the 'set dropping' trigger and sets the value on this view accordingly.\n\t\t * \n\t\t * @since 3.0\n\t\t * @param void\n\t\t */\n\t\tsetDropping: function( val ) {\n\t\t\tthis.dropping = val;\n\t\t},\n\n\t\t/**\n\t\t * When we click \"delete this cell\" in our cell view, remove that cell from its collection\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object \t\t\te        \tevent\n\t\t * @param  Backbone.view \tcellView \tBackbone view representing our single cell view\n\t\t * @return void\n\t\t */\n\t\tdeleteCell: function( e, cellView ) {\n\t\t\tvar cellModel = cellView.model;\n\t\t\tvar cellCollection = cellView.model.collection;\n\t\t\tvar rowModel = cellView.model.collection.options.rowModel;\n\t\t\tvar rowCollection = rowModel.collection;\n\n\t\t\t/*\n\t\t\t * Remove our cell model from the collection.\n\t\t\t */\n\t\t\tcellCollection.remove( cellModel );\n\n\t\t\t/*\n\t\t\t * If we have more than one cell, recalculate our widths\n\t\t\t */\n\t\t\tif ( 1 == cellCollection.models.length ) { // We have one cell.\n\t\t\t\t/*\n\t\t\t\t * If we have one cell, we want to break any fields inside that cell up into their own rows.\n\t\t\t\t */\n\t\t\t\t\n\t\t\t\t// Get the order of our row\n\t\t\t\tvar order = rowModel.get( 'order' );\n\t\t\t\t// Store the new rows that we are going to create\n\t\t\t\tvar newRows = [];\n\t\t\t\t// Create a new row for each field in this cell.\n\t\t\t\t_.each( cellCollection.models[0].get( 'fields' ).models, function( fieldModel ) {\n\t\t\t\t\tvar newRowModel = nfRadio.channel( 'layouts' ).request( 'add:row', cellCollection.options.rowModel.collection, { order: order, field: fieldModel.get( 'id' ) } );\n\t\t\t\t\tnewRows.push( newRowModel );\n\t\t\t\t}, this );\n\n\t\t\t\t/*\n\t\t\t\t * After we insert our new rows, we remove our old row.\n\t\t\t\t */\n\t\t\t\trowCollection.remove( rowModel );\n\t\t\t}\n\t\t\t\n\t\t\t// Set our 'clean' status to false so that we get a notice to publish changes\n\t\t\tnfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );\n\t\t\t// Update our preview\n\t\t\tnfRadio.channel( 'app' ).request( 'update:db' );\n\t\t}\n\t});\n\n\treturn controller;\n} );\n\n","/**\n * Controller that handles events from the gutter/divider droppable\n */\ndefine( 'controllers/gutterDroppable',[], function() {\n\tvar controller = Marionette.Object.extend( {\n\t\tdropped: false,\n\n\t\tinitialize: function() {\n\t\t\t/*\n\t\t\t * Listen for events triggered by our gutter droppables\n\t\t\t */\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'over:gutterDroppable', this.over );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'out:gutterDroppable', this.out );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'drop:gutterDroppable', this.drop );\n\n\t\t\t/*\n\t\t\t * Listen to the drag events of our gutter slider.\n\t\t\t */\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'dragStart:gutterSlider', this.dragStart );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'drag:gutterSlider', this.drag );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'dragEnd:gutterSlider', this.dragEnd );\n\n\t\t},\n\n\t\t/**\n\t\t * When we're over a gutter droppable:\n\t\t * 1) Set our dropped property to false. (Helps prevent duplicate drop events later)\n\t\t * 2) Remove any placeholders on other elements.\n\t\t *\n\t\t * @since  3.0\n\t\t * @param  object e        event\n\t\t * @param  object ui       ui object\n\t\t * @param  object cellView Backbone view\n\t\t * @param  object sortable jQuery UI element\n\t\t * @return void\n\t\t */\n\t\tover: function( e, ui, rowView, droppable ) {\n\t\t\tthis.dropped = false;\n\t\t\tif ( jQuery( ui.helper ).hasClass( 'nf-field-type-draggable' ) ) {\n\t\t\t\tjQuery( ui.helper ).css( 'width', 300 );\n\t\t\t\tjQuery( '#nf-main' ).find( '.nf-fields-sortable-placeholder:not(.gutter)' ).addClass( 'nf-sortable-removed' ).removeClass( 'nf-fields-sortable-placeholder' );\n\t\t\t} else {\n\t\t\t\tjQuery( droppable ).addClass( 'nf-fields-sortable-placeholder' );\n\t\t\t\tjQuery( '#nf-main' ).find( '.nf-fields-sortable-placeholder:not(.gutter)' ).addClass( 'nf-sortable-removed' ).removeClass( 'nf-fields-sortable-placeholder' );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * When we're out of a gutter droppable:\n\t\t * 1) Reset any placeholders we removed in the over event.\n\t\t *\n\t\t * @since  3.0\n\t\t * @param  object e        event\n\t\t * @param  object ui       ui object\n\t\t * @param  object cellView Backbone view\n\t\t * @param  object sortable jQuery UI element\n\t\t * @return void\n\t\t */\n\t\tout: function( e, ui, rowView, droppable ) {\n\t\t\tif ( jQuery( ui.helper ).hasClass( 'nf-field-type-draggable' ) ) {\n\t\t\t\tjQuery( '#nf-main' ).find( '.nf-sortable-removed' ).addClass( 'nf-fields-sortable-placeholder' );\n\t\t\t} else {\n\t\t\t\tjQuery( droppable ).removeClass( 'nf-fields-sortable-placeholder' );\n\t\t\t\tjQuery( '#nf-main' ).find( '.nf-sortable-removed' ).addClass( 'nf-fields-sortable-placeholder' );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * There are three different items that we could be dropping:\n\t\t * 1) A new single field type\n\t\t * 2) The field staging draggable\n\t\t * 3) A field that already exists within another cell.\n\t\t *\n\t\t * Regardless of which we dropped, we create a new cell and eventually re-render the row.\n\t\t *\n\t\t * @since  3.0\n\t\t * @param  object e        \tevent\n\t\t * @param  object ui       \tui object\n\t\t * @param  object rowView \tBackbone view\n\t\t * @param  object sortable \tjQuery UI element\n\t\t * @return void\n\t\t */\n\t\tdrop: function( e, ui, rowView, droppable ) {\n\t\t\t/*\n\t\t\t * Because this droppable is nested inside a sortable, the drop event can be fired when the user drags over it.\n\t\t\t * The solution is to add a check to see when the user has their mousedown.\n\t\t\t *\n\t\t\t * To further make sure that this only fires once, we set \"dropped\" to false in the over event.\n\t\t\t * if \"dropped\" is set to true, we return false.\n\t\t\t */\n\t\t\tif ( jQuery( '#nf-builder' ).data( 'mousedown' ) || this.dropped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// Prevent this drop event from firing twice from the same drop.\n\t\t\tthis.dropped = true;\n\n\t\t\t// Prevent any sortable lists from accepting this item.\n\t\t\tnfRadio.channel( 'layouts' ).trigger( 'set:dropping', true );\n\n\t\t\t// Get the order of our gutter.\n\t\t\tvar order = jQuery( droppable ).index() / 2;\n\t\t\t// Create a new cell in our row collection.\n\t\t\tvar newCell = this.addCell( order, rowView.collection );\n\n\t\t\tif ( jQuery( ui.helper ).hasClass( 'nf-field-type-draggable' ) ) { // Single Add New Field Type\n\t\t\t\tthis.dropNewField( e, ui, rowView, droppable, newCell );\n\t\t\t} else if ( jQuery( ui.helper ).hasClass( 'nf-stage' ) ) { // Field Staging\n\t\t\t\tthis.dropFieldStaging( e, ui, rowView, droppable, newCell );\n\t\t\t} else { // The field dropped already exists in another cell collection.\n\t\t\t\tthis.dropCurrentField( e, ui, rowView, droppable, newCell );\n\t\t\t}\n\n\t\t\t// Update our field order attribute\n\t\t\tnfRadio.channel( 'layouts' ).request( 'update:fieldOrder', rowView.model.collection );\n\t\t\t// Set our 'clean' status to false so that we get a notice to publish changes\n\t\t\tnfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );\n\t\t\t// Update our preview\n\t\t\tnfRadio.channel( 'app' ).request( 'update:db' );\n\t\t\t// Re-apply our sortable class to any that we removed.\n\t\t\tjQuery( '#nf-main' ).find( '.nf-sortable-removed' ).addClass( 'nf-fields-sortable-placeholder' );\n\t\t\t// Re-render our row.\n\t\t\trowView.render();\n\t\t},\n\n\t\t/**\n\t\t * Add a field to our new cell.\n\t\t *\n\t\t * @since  3.0\n\t\t * @param  object \t\t\te         event\n\t\t * @param  object \t\t\tui        jQuery UI element\n\t\t * @param  Backbone.view \trowView   Single Row View\n\t\t * @param  object \t\t\tdroppable jQuery UI element\n\t\t * @param  Backbone.model \tnewCell   cell model\n\t\t * @return void\n\t\t */\n\t\tdropNewField: function( e, ui, rowView, droppable, newCell ) {\n\t\t\t// Get our type string\n\t\t\tvar type = jQuery( ui.draggable ).data( 'id' );\n\t\t\t// Add a field (returns the tmp ID )\n\t\t\tvar newModel = this.addField( type, newCell, false );\n\t\t\t// Remove our dragged element.\n\t\t\tjQuery( ui.helper ).remove();\n\t\t},\n\n\t\t/**\n\t\t * Add a field to our new cell for each item in our staging area.\n\t\t *\n\t\t * @since  3.0\n\t\t * @param  object \t\t\te         event\n\t\t * @param  object \t\t\tui        jQuery UI element\n\t\t * @param  Backbone.view \trowView   Single Row View\n\t\t * @param  object \t\t\tdroppable jQuery UI element\n\t\t * @param  Backbone.model \tnewCell   cell model\n\t\t * @return void\n\t\t */\n\t\tdropFieldStaging: function( e, ui, rowView, droppable, newCell ) {\n\t\t\t// Make sure that our staged fields are sorted properly.\n\t\t\tnfRadio.channel( 'fields' ).request( 'sort:staging' );\n\n\t\t\t// Grab our staged fields.\n\t\t\tvar stagedFields = nfRadio.channel( 'fields' ).request( 'get:staging' );\n\n\t\t\t// Loop through each staged fields model and insert a field.\n\t\t\tvar tmpIDs = [];\n\t\t\t_.each( stagedFields.models, function( field, index ) {\n\t\t\t\t// Add our field.\n\t\t\t\tvar newModel = this.addField( field.get( 'slug' ), newCell );\n\t\t\t}, this );\n\n\t\t\t// Clear our staging\n\t\t\tnfRadio.channel( 'fields' ).request( 'clear:staging' );\n\t\t\t// Remove our helper. Fixes a weird artifact.\n\t\t\tjQuery( ui.helper ).remove();\n\t\t},\n\n\t\t/**\n\t\t * Copy a field to our new cell that already exists on the form.\n\t\t *\n\t\t * @since  3.0\n\t\t * @param  object \t\t\te         event\n\t\t * @param  object \t\t\tui        jQuery UI element\n\t\t * @param  Backbone.view \trowView   Single Row View\n\t\t * @param  object \t\t\tdroppable jQuery UI element\n\t\t * @param  Backbone.model \tnewCell   cell model\n\t\t * @return void\n\t\t */\n\t\tdropCurrentField: function( e, ui, rowView, droppable, newCell ) {\n\t\t\t// Get our field id.\n\t\t\tvar fieldID = jQuery( ui.draggable ).data( 'id' );\n\t\t\t// Get our field model from the ID\n\t\t\tvar fieldModel = nfRadio.channel( 'fields' ).request( 'get:field', fieldID );\n\t\t\tvar oldCollection = ui.draggable.fieldCollection;\n\t\t\t// Add our field to our new cell model\n\t\t\tnewCell.get( 'fields' ).add( fieldModel );\n\t\t\t// Remove our field from its old cell model.\n\t\t\tui.draggable.fieldCollection.remove( fieldModel );\n\t\t\t// Remove the element that was originally dragged. Keep the helper.\n\t\t\tjQuery( ui.draggable ).remove();\n\t\t},\n\n\t\tdragStart: function( data, cellCollection ) {\n\t\t\tvar widths = this.getDraggedWidths( data, cellCollection );\n\t\t\tvar percentLeft = widths.a;\n\t\t\tvar percentRight = widths.b;\n\n\t\t\tjQuery( data.gutter ).append( '<span class=\"percent-left\">' + percentLeft + '%</span><span class=\"percent-right\">' + percentRight + '%</span>' );\n\t\t},\n\n\t\tdrag: function( data, cellCollection ) {\n\t\t\tvar widths = this.getDraggedWidths( data, cellCollection );\n\t\t\tvar percentLeft = widths.a;\n\t\t\tvar percentRight = widths.b;\n\n\t\t\tjQuery( data.gutter ).find( '.percent-left' ).html( percentLeft + '%' );\n\t\t\tjQuery( data.gutter ).find( '.percent-right' ).html( percentRight + '%' );\n\t\t},\n\n\t\t/**\n\t\t * When we resize our cell, update the data model.\n\t\t *\n\t\t * @since  3.0\n\t\t * @param  object \tdata Split.js data object\n\t\t * @return void\n\t\t */\n\t\tdragEnd: function( data, cellCollection ) {\n\t\t\tvar widths = this.getDraggedWidths( data, cellCollection );\n\t\t\tvar awidth = widths.a;\n\t\t\tvar bwidth = widths.b;\n\n\t\t\t// Get our data models.\n\t\t\tvar modelA = jQuery( data.a ).data( 'model' );\n\t\t\tvar modelB = jQuery( data.b ).data( 'model' );\n\n\t\t\tvar oldModelAWidth = modelA.get( 'width' );\n\t\t\tvar oldModelBWidth = modelB.get( 'width' );\n\n\t\t\tjQuery( data.gutter ).find( '.percent-left' ).remove();\n\t\t\tjQuery( data.gutter ).find( '.percent-right' ).remove();\n\n\t\t\tif ( oldModelAWidth == awidth && oldModelBWidth == bwidth ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Update our width\n\t\t\tmodelA.set( 'width', awidth );\n\t\t\tmodelB.set( 'width', bwidth );\n\n\t\t\t// Set our 'clean' status to false so that we get a notice to publish changes\n\t\t\tnfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );\n\t\t\t// Update our preview\n\t\t\tnfRadio.channel( 'app' ).request( 'update:db' );\n\n\t\t},\n\n\t\t/**\n\t\t * Add a field.\n\t\t * Builds the object necessary to add a field to the field model collection.\n\t\t *\n\t\t * @since  3.0\n\t\t * @param  string \t\t\t\ttype   \t\tfield type\n\t\t * @param  Backbone.object   \tnewCell \tthe cell this field lives in\n\t\t * @param  boolean \t\t\t\tsilent \t\tadd silently\n\t\t * @return model \t\t\t\tnewModel\n\t\t */\n\t\taddField: function( type, newCell, silent ) {\n\t\t\t// Default to false\n\t\t\tsilent = silent || false;\n\t\t\trenderField = false;\n\t\t\t// Get our field type model\n\t\t\tvar fieldType = nfRadio.channel( 'fields' ).request( 'get:type', type );\n\t\t\t// Get our tmp ID\n\t\t\tvar tmpID = nfRadio.channel( 'fields' ).request( 'get:tmpID' );\n\t\t\t// Add our field\n\t\t\tvar newModel = nfRadio.channel( 'fields' ).request( 'add',  { id: tmpID, label: fieldType.get( 'nicename' ), type: type, cellcid: newCell.cid }, silent, renderField );\n\t\t\t\n\t\t\treturn newModel;\n\t\t},\n\n\t\t/**\n\t\t * Add a cell to the passed collection.\n\t\t *\n\t\t * @since  3.0\n\t\t * @param  int \t\t\t\t\torder      \tOrder for our new cell in the row\n\t\t * @param  Backbone.collection \tcollection \tCell collection\n\t\t * @param  array \t\t\t\tfields     \tOptional array of fields to add to the cell.\n\t\t * @return Backbone.model \t\tnewCell \tNew cell model\n\t\t */\n\t\taddCell: function( order, collection, fields ) {\n\t\t\tvar fields = fields || [];\n\t\t\t// Update any cells that have an order equal to or higher than our order.\n\t\t\t_.each( collection.models, function( cell ) {\n\t\t\t\tif ( cell.get( 'order' ) >= order ) {\n\t\t\t\t\tcell.set( 'order', cell.get( 'order' ) + 1 );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// Add a new cell to our cell collection.\n\t\t\tvar newCell = collection.add( {\n\t\t\t\torder: order,\n\t\t\t\tfields: fields,\n\t\t\t\twidth: ''\n\t\t\t} );\n\n\t\t\t// collection.sort();\n\n\t\t\treturn newCell;\n\t\t},\n\n\t\tgetDraggedWidths: function( data, cellCollection ) {\n\t\t\t// Get the widths of the cell to the left and right of the dragged gutter.\n\t\t\tvar awidth = jQuery( data.a ).data( 'width' );\n\t\t\tvar bwidth = jQuery( data.b ).data( 'width' );\n\n\t\t\treturn {\n\t\t\t\ta: awidth,\n\t\t\t\tb: bwidth,\n\t\t\t}\n\t\t}\n\t});\n\n\treturn controller;\n} );\n\n","/**\n * Controller that handles row collection sortables.\n */\ndefine( 'controllers/rowsSortable',[], function() {\n\tvar controller = Marionette.Object.extend( {\n\t\tdropping: false,\n\n\t\tinitialize: function() {\n\t\t\t/*\n\t\t\t * Listen for events from our row collection sortable.\n\t\t\t */\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'over:rowsSortable', this.over );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'out:rowsSortable', this.out );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'start:rowsSortable', this.start );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'stop:rowsSortable', this.stop );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'update:rowsSortable', this.update );\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'receive:rowsSortable', this.receive );\n\t\t\t\n\t\t\t/*\n\t\t\t * Listen to our set dropping trigger\n\t\t\t */\n\t\t\tthis.listenTo( nfRadio.channel( 'layouts' ), 'set:dropping', this.setDropping );\n\t\t},\n\n\t\t/**\n\t\t * When we start dragging, set our dropping value to false and fire the default Ninja Forms event.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object \t\t\te \t\t \tevent object\n\t\t * @param  object \t\t\tui       \tjQuery UI element\n\t\t * @param  Backbone.view \trowsView \tBackbone view\n\t\t * @param  object \t\t\tsortable \tjQuery UI element\n\t\t * @return void\n\t\t */\n\t\tstart: function( e, ui, rowsView, sortable ) {\n\t\t\tif ( this.dropping ) {\n\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'set:dropping', false );\n\t\t\t}\n\t\t\tnfRadio.channel( 'app' ).request( 'start:fieldsSortable', ui );\n\t\t},\n\n\t\t/**\n\t\t * When we drag over our sortable, set our helper width and fire the default Ninja Forms event.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object \t\t\te \t\t \tevent object\n\t\t * @param  object \t\t\tui       \tjQuery UI element\n\t\t * @param  Backbone.view \trowsView \tBackbone view\n\t\t * @param  object \t\t\tsortable \tjQuery UI element\n\t\t * @return void\n\t\t */\n\t\tover: function( e, ui, rowsView, sortable ) {\n\t\t\tjQuery( ui.helper ).css( 'width', jQuery( sortable ).css( 'width' ) );\n\t\t\tnfRadio.channel( 'app' ).request( 'over:fieldsSortable', ui );\n\t\t},\n\n\t\t/**\n\t\t * When we drag out of our sortable, fire the default Ninja Forms event.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object \t\t\te \t\t \tevent object\n\t\t * @param  object \t\t\tui       \tjQuery UI element\n\t\t * @param  Backbone.view \trowsView \tBackbone view\n\t\t * @param  object \t\t\tsortable \tjQuery UI element\n\t\t * @return void\n\t\t */\n\t\tout: function( e, ui, rowsView, sortable ) {\n\t\t\tnfRadio.channel( 'app' ).request( 'out:fieldsSortable', ui );\n\t\t},\n\n\t\t/**\n\t\t * When we stop dragging our sortable, fire the default Ninja Forms event.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object \t\t\te \t\t \tevent object\n\t\t * @param  object \t\t\tui       \tjQuery UI element\n\t\t * @param  Backbone.view \trowsView \tBackbone view\n\t\t * @param  object \t\t\tsortable \tjQuery UI element\n\t\t * @return void\n\t\t */\n\t\tstop: function( e, ui, rowsView, sortable ) {\n\t\t\tnfRadio.channel( 'app' ).request( 'stop:fieldsSortable', ui );\n\t\t},\n\n\t\t/**\n\t\t * When we update the order of our sortable update the order of the models in our collection.\n\t\t * We only want to update if the user didn't drop on a gutter/divider.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object \t\t\te \t\t \tevent object\n\t\t * @param  object \t\t\tui       \tjQuery UI element\n\t\t * @param  Backbone.view \trowsView \tBackbone view\n\t\t * @param  object \t\t\tsortable \tjQuery UI element\n\t\t * @return void\n\t\t */\n\t\tupdate: function( e, ui, rowsView, sortable ) {\n\t\t\t// Make sure that we're dropping a field and that we aren't dropping on a gutter/divider\n\t\t\tif( ! jQuery( ui.item ).hasClass( 'nf-stage' ) && ! jQuery( ui.item ).hasClass( 'nf-field-wrap' ) && ! this.dropping ) {\n\t\t\t\tvar order = jQuery( sortable ).sortable( 'toArray' );\n\t\t\t\tvar oldOrder = [];\n\t\t\t\t// var rowCollection = nfRadio.channel( 'layouts-row' ).request( 'get:collection' );\n\t\t\t\t_.each( order, function( cid, index ) {\n\t\t\t\t\toldOrder[ rowsView.collection.get( { cid: cid } ).get( 'order' ) ] = cid;\n\t\t\t\t\trowsView.collection.get( { cid: cid } ).set( 'order', index + 1 );\n\t\t\t\t} );\n\n\t\t\t\trowsView.collection.sort();\n\n\t\t\t\t// Update our field order attribute\n\t\t\t\tnfRadio.channel( 'layouts' ).request( 'update:fieldOrder', rowsView.collection );\n\n\t\t\t\tvar rowcid = jQuery( ui.item ).data( 'id' );\n\t\t\t\tvar droppedRow = rowsView.collection.get( { cid: rowcid } );\n\n\t\t\t\t// Set our 'clean' status to false so that we get a notice to publish changes\n\t\t\t\tnfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );\n\t\t\t\t// Update our preview\n\t\t\t\tnfRadio.channel( 'app' ).request( 'update:db' );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * When we receive an element, we are receiving:\n\t\t * 1) A field from cell sortable\n\t\t * 2) A single new field type\n\t\t * 3) Or the fields staging.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  object \t\t\te \t\t \tevent object\n\t\t * @param  object \t\t\tui       \tjQuery UI element\n\t\t * @param  Backbone.view \trowsView \tBackbone view\n\t\t * @param  object \t\t\tsortable \tjQuery UI element\n\t\t * @return void\n\t\t */\n\t\treceive: function( e, ui, rowsView, sortable ) {\n\t\t\t/*\n\t\t\t * If we are dropping on a gutter, the this.dropping will be set to true.\n\t\t\t * Once we know we've dropped, reset dropping to false.\n\t\t\t * We only want to receive if we didn't drop on a gutter/divider.\n\t\t\t */\n\t\t\tif ( this.dropping || typeof jQuery(ui.helper) !== \"undefined\" && jQuery(ui.helper).hasClass('nf-over-repeater') ) {\n\t\t\t\tnfRadio.channel( 'layouts' ).trigger( 'set:dropping', false );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif( jQuery( ui.item ).hasClass( 'nf-field-wrap' ) ) { // Receiving an item from a cell sortable\n\t\t\t\tthis.receiveCurrentField( e, ui, rowsView, sortable );\n\t\t\t} else if ( jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) ) { // We've received a field type button\n\t\t\t\tthis.receiveNewField( e, ui, rowsView, sortable );\n\t\t\t} else if ( jQuery( ui.item ).hasClass( 'nf-stage' ) ) { // Staging\n\t\t\t\tthis.receiveFieldStaging( e, ui, rowsView, sortable );\n\t\t\t}\n\t\t\t// Update our field order attribute\n\t\t\tnfRadio.channel( 'layouts' ).request( 'update:fieldOrder', rowsView.collection );\n\t\t\t// Set our 'clean' status to false so that we get a notice to publish changes\n\t\t\tnfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );\n\t\t\t// Update our preview\n\t\t\tnfRadio.channel( 'app' ).request( 'update:db' );\n\t\t},\n\n\t\treceiveNewField: function( e, ui, rowsView, sortable ) {\n\t\t\t// Get the location where we've dropped the item.\t\n\t\t\tvar order = ui.helper.index() + 1;\n\t\t\t// Get our type string\n\t\t\tvar type = jQuery( ui.item ).data( 'id' );\n\t\t\t// Add a new field for our type, returning its tmp id.\n\t\t\tvar fieldModel = this.addField( type, order, true );\n\n\t\t\tthis.addRow( order, rowsView.collection, [ fieldModel.get( 'key' ) ], true );\n\t\t\t// Remove our helper\n\t\t\tjQuery( ui.helper ).remove();\n\t\t},\n\n\t\treceiveFieldStaging: function( e, ui, rowsView, sortable ) {\n\t\t\t// Get the location where we've dropped the item.\t\n\t\t\tvar order = ui.helper.index() + 1;\n\t\t\t// Make sure that our staged fields are sorted properly.\t\n\t\t\tnfRadio.channel( 'fields' ).request( 'sort:staging' );\n\t\t\t// Grab our staged fields.\n\t\t\tvar stagedFields = nfRadio.channel( 'fields' ).request( 'get:staging' );\n\t\t\t\n\t\t\t// Loop through each staged fields model and insert a field.\n\t\t\t_.each( stagedFields.models, function( field, index ) {\n\t\t\t\t// Add a new field for our type, returning its tmp id.\n\t\t\t\tvar fieldModel = this.addField( field.get( 'slug' ), order, true );\n\t\t\t\tthis.addRow( order, rowsView.collection, [ fieldModel.get( 'id' ) ] );\n\t\t\t\torder++;\n\t\t\t}, this );\n\n\t\t\t// Clear our staging\n\t\t\tnfRadio.channel( 'fields' ).request( 'clear:staging' );\n\t\t\t// Remove our helper. Fixes a weird artifact.\n\t\t\tjQuery( ui.helper ).remove();\n\t\t},\n\n\t\treceiveCurrentField: function( e, ui, rowsView, sortable ) {\n\t\t\tvar oldCID = ui.item.fieldCollection.options.cellModel.collection.options.rowModel.cid;\n\t\t\tvar prevOrder = ui.item.fieldCollection.options.cellModel.collection.options.rowModel.get( 'order' );\t\t\n\t\t\tvar droppedOrder = ( prevOrder < jQuery( ui.item ).index() ) ? jQuery( ui.item ).index() : jQuery( ui.item ).index() + 1;\n\t\t\tvar fieldID = jQuery( ui.item ).data( 'id' );\n\n\t\t\tvar oldOrder = [];\n\t\t\t// Update any rows that have an order equal to or higher than our order.\n\t\t\t_.each( rowsView.collection.models, function( rowModel ) {\n\t\t\t\toldOrder[ rowModel.get( 'order') ] = rowModel.cid;\n\t\t\t} );\n\n\t\t\t/*\n\t\t\t * Remove the field from its collection.\n\t\t\t * This will bubble up, causing the row to remove itself as well.\n\t\t\t */\n\t\t\tvar fieldModel = nfRadio.channel( 'fields' ).request( 'get:field', fieldID );\n\t\t\tui.item.fieldCollection.remove( fieldModel );\n\n\t\t\trowsView.collection.each( function( model, index ) {\n\t\t\t\tmodel.set( 'order', index + 1 );\n\t\t\t} );\n\n\t\t\tvar rowModel = this.addRow( droppedOrder, rowsView.collection, [ fieldID ] );\n\n\t\t\toldOrder[ oldOrder.indexOf( oldCID ) ] = rowModel.cid;\n\t\t},\n\n\t\t/**\n\t\t * Add a row to the passed row collection.\n\t\t * \n\t\t * @since 3.0\n\t\t * @param int \t\t\t\t\torder      Index of the dropped item\n\t\t * @param Backbone.collection \tcollection Row collection\n\t\t * @param array \t\t\t\tfields  IDs of the fields we're adding (optional)\n\t\t * @param bool \t\t\t\t\tsilent     [description]\n\t\t */\n\t\taddRow: function( order, collection, fields, silent ) {\n\t\t\tvar fields = fields || [];\n\t\t\tvar silent = silent || false;\n\n\t\t\t// Update any rows that have an order equal to or higher than our order.\n\t\t\t_.each( collection.models, function( rowModel ) {\n\t\t\t\tif ( parseInt( rowModel.get( 'order' ) ) >= order ) {\n\t\t\t\t\tvar newOrder = rowModel.get( 'order' ) + 1;\n\t\t\t\t\trowModel.set( 'order', newOrder );\n\t\t\t\t}\n\t\t\t} );\n\t\t\t\n\t\t\t// Add a row model into our collection.\n\t\t\tvar newRow = collection.add( {\n\t\t\t\torder: order,\n\t\t\t\tcells: [\n\t\t\t\t\t{\n\t\t\t\t\t\torder: 0,\n\t\t\t\t\t\tfields: fields,\n\t\t\t\t\t\twidth: '100'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}, { silent: silent } );\n\n\t\t\t\n\t\t\tcollection.sort( { silent: true } );\n\n\t\t\t/* \n\t\t\t * When we add a row to our collection, the order attributes might get askew: 1,3,7 etc.\n\t\t\t * Update our order so that all of our numbers are consecutive.\n\t\t\t */\n\t\t\t_.each( collection.models, function( rowModel, index ) {\n\t\t\t\trowModel.set( 'order', index + 1 );\n\t\t\t} );\n\n\t\t\tcollection.sort();\n\t\t\n\t\t\treturn newRow;\n\n\t\t},\n\n\t\t/**\n\t\t * Add a field.\n\t\t * Builds the object necessary to add a field to the field model collection.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  string \ttype   field type\n\t\t * @param  boolean \tsilent add silently\n\t\t * @return string \ttmpID\n\t\t */\n\t\taddField: function( type, order, silent ) {\n\t\t\t// Default to false\n\t\t\tsilent = silent || false;\n\t\t\t// Get our field type model\n\t\t\tvar fieldType = nfRadio.channel( 'fields' ).request( 'get:type', type ); \n\t\t\t// Add our field\n\t\t\tvar newModel = nfRadio.channel( 'fields' ).request( 'add',  { label: fieldType.get( 'nicename' ), type: type }, silent, false );\n\t\t\treturn newModel;\n\t\t},\n\n\t\tsetDropping: function( val ) {\n\t\t\tthis.dropping = val;\n\t\t}\n\n\t});\n\n\treturn controller;\n} );\n\n","/**\n * Listen and respond to undo events.\n */\ndefine( 'controllers/undo',[], function() {\n\tvar controller = Marionette.Object.extend( {\n\t\tinitialize: function() {\n\t\t\tnfRadio.channel( 'changes' ).reply( 'undo:movedBetweenCells', this.undoMovedBetweenCells, this );\n\t\t\tnfRadio.channel( 'changes' ).reply( 'undo:gutterDropNewField', this.undoGutterDropNewField, this );\n\t\t\tnfRadio.channel( 'changes' ).reply( 'undo:gutterSplitCell', this.undoGutterSplitCell, this );\n\t\t\tnfRadio.channel( 'changes' ).reply( 'undo:cellSorting', this.undoCellSorting, this );\n\t\t\tnfRadio.channel( 'changes' ).reply( 'undo:removedCell', this.undoRemovedCell, this );\n\t\t\tnfRadio.channel( 'changes' ).reply( 'undo:cellNewField', this.undoCellNewField, this );\n\t\t\tnfRadio.channel( 'changes' ).reply( 'undo:rowNewField', this.undoRowNewField, this );\n\t\t\tnfRadio.channel( 'changes' ).reply( 'undo:gutterResize', this.undoGutterResize, this );\n\t\t\tnfRadio.channel( 'changes' ).reply( 'undo:movedToNewRow', this.undoMovedToNewRow, this );\n\t\t\tnfRadio.channel( 'changes' ).reply( 'undo:rowSorting', this.undoRowSorting, this );\n\t\t},\n\n\t\t/**\n\t\t * Undo moving a field between cells.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  Backbone.model \tchange  change model\n\t\t * @param  bool \t\t\tundoAll are we undoing everything?\n\t\t * @return void\n\t\t */\n\t\tundoMovedBetweenCells: function( change, undoAll ) {\n\t\t\tvar fieldModel = change.get( 'model' );\n\t\t\tvar senderOldOrder = change.get( 'data' ).senderOldOrder;\n\t\t\tvar receiverOldOrder = change.get( 'data' ).receiverOldOrder;\n\t\t\t\n\t\t\tvar originalCollection = change.get( 'data' ).originalCollection;\n\t\t\tvar newCollection = change.get( 'data' ).newCollection;\n\t\t\t\n\t\t\toriginalCollection.add( fieldModel );\n\t\t\t/*\n\t\t\t * We have to update every model's order based upon our order array.\n\t\t\t * Loop through all of our fields and update their order value\n\t\t\t */\n\t\t\t_.each( originalCollection.models, function( field ) {\n\t\t\t\tvar id = field.get( 'id' );\n\t\t\t\t\n\t\t\t\t// Get the index of our field inside our order array\n\t\t\t\tvar newPos = senderOldOrder.indexOf( id );\n\t\t\t\tfield.set( 'cellOrder', newPos );\n\t\t\t} );\n\n\t\t\toriginalCollection.sort();\n\n\t\t\tnewCollection.remove( fieldModel );\n\n\t\t\t/*\n\t\t\t * We have to update every model's order based upon our order array.\n\t\t\t * Loop through all of our fields and update their order value\n\t\t\t */\n\t\t\t_.each( newCollection.models, function( field ) {\n\t\t\t\tvar id = field.get( 'id' );\n\t\t\t\t\n\t\t\t\t// Get the index of our field inside our order array\n\t\t\t\tvar newPos = receiverOldOrder.indexOf( id );\n\t\t\t\tfield.set( 'cellOrder', newPos );\n\t\t\t} );\n\n\t\t\tnewCollection.sort();\n\n\t\t\tthis.maybeRemoveChange( change, undoAll );\n\t\t\t/*\n\t\t\t * Enable the next Layouts change\n\t\t\t */\n\t\t\tthis.enableNextChange();\n\t\t},\n\n\t\t/**\n\t\t * Undo dropping a new field type onto our gutter/divider\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  Backbone.model \tchange  change model\n\t\t * @param  bool \t\t\tundoAll are we undoing everything?\n\t\t * @return void\n\t\t */\n\t\tundoGutterDropNewField: function( change, undoAll ) {\n\t\t\t// Remove our new field\n\t\t\tvar fieldModel = change.get( 'model' );\n\t\t\tvar fieldCollection = change.get( 'data' ).fieldCollection;\n\t\t\tvar newCell = change.get( 'data' ).newCell;\n\n\t\t\tfieldCollection.remove( fieldModel );\n\t\t\t// Remove our new cell if we don't have any fields left\n\t\t\tif ( 0 == newCell.get( 'fields' ).models.length ) {\n\t\t\t\tnewCell.collection.remove( newCell );\t\t\t\t\n\t\t\t}\n\n\t\t\tthis.maybeRemoveChange( change, undoAll );\n\n\t\t\t/*\n\t\t\t * Enable the next Layouts change\n\t\t\t */\n\t\t\tthis.enableNextChange();\n\t\t},\n\n\t\t/**\n\t\t * Undo dropping an existing field onto a gutter and adding a new cell.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  Backbone.model \tchange  change model\n\t\t * @param  bool \t\t\tundoAll are we undoing everything?\n\t\t * @return void\n\t\t */\n\t\tundoGutterSplitCell: function( change, undoAll ) {\n\t\t\tvar fieldModel = change.get( 'model' );\n\t\t\tvar oldCollection = change.get( 'data' ).oldCollection;\n\t\t\tvar newCell = change.get( 'data' ).newCell;\n\t\t\tvar cellCollection = change.get( 'data' ).cellCollection;\n\n\t\t\t/*\n\t\t\t * Check to see if this was the only item in a row.\n\t\t\t * If it was, we need to insert a new row.\n\t\t\t */\n\t\t\tif( 'undefined' == typeof oldCollection.options.cellModel.collection.options.rowModel.collection ) {\n\t\t\t\tvar order = oldCollection.options.cellModel.collection.options.rowModel.get( 'order' );\n\t\t\t\tvar newRowModel = nfRadio.channel( 'layouts' ).request( 'add:row', cellCollection.options.rowModel.collection, { order: order, field: fieldModel.get( 'id' ) } );\n\t\t\t} else { // We can just add the field back to it's original collection because a row already exists.\n\t\t\t\toldCollection.add( fieldModel );\n\t\t\t}\n\n\t\t\t// Remove our new cell\n\t\t\tnewCell.get( 'fields' ).remove( fieldModel );\n\t\t\tcellCollection.remove( newCell )\n\t\t\tcellCollection.sort();\t\n\n\t\t\tthis.maybeRemoveChange( change, undoAll );\n\n\t\t\t/*\n\t\t\t * Enable the next Layouts change\n\t\t\t */\n\t\t\tthis.enableNextChange();\n\t\t},\n\n\t\tundoCellSorting: function( change, undoAll ) {\n\t\t\tvar data = change.get( 'data' );\n\t\t\tvar fieldCollection = data.fieldCollection;\n\t\t\tvar order = data.oldOrder;\n\n\t\t\t/*\n\t\t\t * We have to update every model's order based upon our order array.\n\t\t\t * Loop through all of our fields and update their order value\n\t\t\t */\n\t\t\t_.each( fieldCollection.models, function( field ) {\n\t\t\t\tvar id = field.get( 'id' );\n\t\t\t\t\n\t\t\t\t// Get the index of our field inside our order array\n\t\t\t\tvar newPos = order.indexOf( id );\n\t\t\t\tfield.set( 'cellOrder', newPos );\n\t\t\t} );\n\n\t\t\tfieldCollection.sort();\n\n\t\t\tthis.maybeRemoveChange( change, undoAll );\n\n\t\t\t/*\n\t\t\t * Enable the next Layouts change\n\t\t\t */\n\t\t\tthis.enableNextChange();\n\t\t},\n\n\t\tundoRemovedCell: function( change, undoAll ) {\n\t\t\tvar data = change.get( 'data' );\n\t\t\tvar cellModel = data.cellModel;\n\t\t\tvar cellCollection = data.cellCollection;\n\t\t\tvar rowModel = data.rowModel;\n\t\t\tvar rowCollection = data.rowCollection;\n\n\t\t\t/*\n\t\t\t * Put the cell back into our cell collection.\n\t\t\t */\n\t\t\tcellCollection.add( cellModel );\n\n\t\t\t/*\n\t\t\t * If we don't have a data.newRows property, then we didn't create new rows as a result of our cell removal.\n\t\t\t */\n\t\t\tif ( 'undefined' != typeof data.newRows ) { // We removed a cell that resulted in creating a bunch of new rows.\n\t\t\t\tvar newRows = data.newRows;\n\t\t\t\t// Remove our old rows\n\t\t\t\trowCollection.remove( newRows );\n\t\t\t\t// Re-add our row model that was removed.\n\t\t\t\trowCollection.add( rowModel );\n\t\t\t}\n\n\t\t\tthis.maybeRemoveChange( change, undoAll );\n\n\t\t\t/*\n\t\t\t * Enable the next Layouts change\n\t\t\t */\n\t\t\tthis.enableNextChange();\n\t\t},\n\n\t\tundoCellNewField: function( change, undoAll ) {\n\t\t\t// Remove our new field\n\t\t\tvar fieldModel = change.get( 'model' );\n\t\t\tvar fieldCollection = change.get( 'data' ).collection;\n\t\t\tfieldCollection.remove( fieldModel );\n\n\t\t\tthis.maybeRemoveChange( change, undoAll );\n\n\t\t\t/*\n\t\t\t * Enable the next Layouts change\n\t\t\t */\n\t\t\tthis.enableNextChange();\n\t\t},\n\n\t\tundoRowNewField: function( change, undoAll ) {\n\t\t\t// Remove our new field\n\t\t\tvar fieldModel = change.get( 'model' );\n\t\t\tvar fieldCollection = change.get( 'data' ).collection;\n\t\t\tfieldCollection.remove( fieldModel );\n\n\t\t\tthis.maybeRemoveChange( change, undoAll );\n\n\t\t\t/*\n\t\t\t * Enable the next Layouts change\n\t\t\t */\n\t\t\tthis.enableNextChange();\n\t\t},\n\n\t\tundoGutterResize: function( change, undoAll ) {\n\t\t\t// Reset our sizes\n\t\t\tvar data = change.get( 'data' );\n\t\t\tvar gutter = data.gutter; \n\t\t\tvar cellCollection = data.cellCollection;\n\t\t\tvar modelA = data.modelA;\n\t\t\tvar modelB = data.modelB;\n\n\t\t\tvar oldModelAWidth = data.oldModelAWidth;\n\t\t\tvar oldModelBWidth = data.oldModelBWidth;\n\n\t\t\tmodelA.set( 'width', oldModelAWidth );\n\t\t\tmodelB.set( 'width', oldModelBWidth );\n\n\t\t\tjQuery( gutter ).find( '.percent-left' ).remove();\n\t\t\tjQuery( gutter ).find( '.percent-right' ).remove();\n\n\t\t\tcellCollection.sort();\n\n\t\t\tthis.maybeRemoveChange( change, undoAll );\n\n\t\t\t/*\n\t\t\t * Enable the next Layouts change\n\t\t\t */\n\t\t\tthis.enableNextChange();\n\n\t\t},\n\n\t\tundoMovedToNewRow: function( change, undoAll ) {\n\t\t\t/*\n\t\t\t * Move the field back to its original cell.\n\t\t\t */\n\t\t\tvar fieldModel = change.get( 'model' );\n\t\t\tvar originalCollection = change.get( 'data' ).originalCollection;\n\t\t\toriginalCollection.add( fieldModel );\n\n\t\t\t/*\n\t\t\t * Remove our new row model\n\t\t\t */\n\t\t\tvar rowModel = change.get( 'data' ).rowModel;\n\t\t\trowModel.collection.remove( rowModel );\n\n\t\t\tthis.maybeRemoveChange( change, undoAll );\n\n\t\t\t/*\n\t\t\t * Enable the next Layouts change\n\t\t\t */\n\t\t\tthis.enableNextChange();\n\t\t},\n\n\t\tundoRowSorting: function( change, undoAll ) {\n\t\t\tvar oldOrder = change.get( 'data' ).oldOrder;\n\t\t\tvar rowCollection = change.get( 'data' ).rowCollection;\n\n\t\t\t/*\n\t\t\t * We have to update every model's order based upon our order array.\n\t\t\t * Loop through all of our fields and update their order value\n\t\t\t */\n\t\t\t_.each( rowCollection.models, function( rowModel ) {\n\t\t\t\tvar cid = rowModel.cid;\n\t\t\t\t\n\t\t\t\t// Get the index of our field inside our order array\n\t\t\t\tvar newPos = oldOrder.indexOf( cid );\n\t\t\t\trowModel.set( 'order', newPos );\n\t\t\t} );\n\n\t\t\trowCollection.sort();\n\n\t\t\tthis.maybeRemoveChange( change, undoAll );\n\n\t\t\t/*\n\t\t\t * Enable the next Layouts change\n\t\t\t */\n\t\t\tthis.enableNextChange();\n\t\t},\n\n\t\tenableNextChange: function() {\n\t\t\t/*\n\t\t\t * Enable the next Layouts change\n\t\t\t */\n\t\t\tvar changeCollection = nfRadio.channel( 'changes' ).request( 'get:collection' );\n\t\t\tvar found = false;\n\t\t\t_.each( changeCollection.models, function( changeModel ) {\n\t\t\t\tvar data = changeModel.get( 'data' );\n\t\t\t\tif ( ! found && 'undefined' != typeof data.layouts && data.layouts ) {\n\t\t\t\t\tchangeModel.set( 'disabled', false );\n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t}, this );\n\t\t},\n\n\t\t/**\n\t\t * If our undo action was requested to 'remove' the change from the collection, remove it.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  backbone.model \tchange \tmodel of our change\n\t\t * @param  boolean \t\t\tremove \tshould we remove this item from our change collection\n\t\t * @return void\n\t\t */\n\t\tmaybeRemoveChange: function( change, undoAll ) {\t\t\t\n\t\t\tvar undoAll = typeof undoAll !== 'undefined' ? undoAll : false;\n\t\t\tif ( ! undoAll ) {\n\t\t\t\t// Update preview.\n\t\t\t\tnfRadio.channel( 'app' ).request( 'update:db' );\n\t\t\t\tvar changeCollection = nfRadio.channel( 'changes' ).request( 'get:collection' );\n\t\t\t\tchangeCollection.remove( change );\n\t\t\t\tif ( 0 == changeCollection.length ) {\n\t\t\t\t\tnfRadio.channel( 'app' ).request( 'update:setting', 'clean', true );\n\t\t\t\t\tnfRadio.channel( 'app' ).request( 'close:drawer' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\treturn controller;\n} );\n\n","/**\n * Recalculates our field order attribute.\n * This isn't the attribute used by Layouts but the one used by core.\n *\n * @since  3.0\n */ \ndefine( 'controllers/updateFieldOrder',[], function() {\n\tvar controller = Marionette.Object.extend( {\n\t\tinitialize: function() {\n\t\t\tnfRadio.channel( 'layouts' ).reply( 'update:fieldOrder', this.updateFieldOrder );\n\t\t},\n\n\t\tupdateFieldOrder: function( rowCollection ) {\n\t\t\tvar order = 1;\n\t\t\t/*\n\t\t\t * Loop over our row collection and set the order attribute for any fields we find inside the cells.\n\t\t\t */\n\t\t\t_.each( rowCollection.models, function( rowModel, rowIndex ) {\n\t\t\t\t/*\n\t\t\t\t * Loop over our cells and update our field models 'order' attribute.\n\t\t\t\t */\n\t\t\t\t_.each( rowModel.get( 'cells' ).models, function( cellModel, cellIndex ) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Loop over every field in our cell model and update its 'order' attribute.\n\t\t\t\t\t */\n\t\t\t\t\t_.each( cellModel.get( 'fields' ).models, function( fieldModel, fieldIndex ) {\n\t\t\t\t\t\tfieldModel.set( 'order', order, { silent: true } );\n\t\t\t\t\t\torder++;\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\n\t});\n\n\treturn controller;\n} );\n\n","define( \n\t'controllers/loadControllers',[\n\t\t'controllers/data',\n\t\t'controllers/maxCols',\n\t\t'controllers/addField',\n\t\t'controllers/cellSortable',\n\t\t'controllers/gutterDroppable',\n\t\t'controllers/rowsSortable',\n\t\t'controllers/undo',\n\t\t'controllers/updateFieldOrder'\n\t], \n\tfunction\n\t(\n\t\tData,\n\t\tMaxCols,\n\t\tAddField,\n\t\tCellSortable,\n\t\tGutterDroppable,\n\t\tRowsSortable,\n\t\tUndo,\n\t\tUpdateFieldOrder\n\t)\n\t{\n\tvar controller = Marionette.Object.extend( {\n\t\tinitialize: function() {\n\t\t\tnew MaxCols();\n\t\t\tnew Data();\n\t\t\tnew AddField();\n\t\t\tnew CellSortable();\n\t\t\tnew GutterDroppable();\n\t\t\tnew RowsSortable();\n\t\t\tnew Undo();\n\t\t\tnew UpdateFieldOrder();\n\t\t}\n\n\t});\n\n\treturn controller;\n} );\n","define( 'controllers/loadContent',['views/rowCollection', 'controllers/loadControllers', 'models/rowCollection'], function( RowCollectionView, LoadControllers, RowCollection ) {\n\tvar controller = Marionette.Object.extend( {\n\t\tinitialize: function() {\n\t\t\tthis.listenTo( nfRadio.channel( 'app' ), 'after:loadControllers', this.loadControllers );\n\t\t},\n\n\t\tloadControllers: function() {\n\t\t\tnew LoadControllers();\n\n\t\t\tnfRadio.channel( 'formContent' ).request( 'add:viewFilter', this.getFormContentView, 4, this );\n\t\t\tnfRadio.channel( 'formContent' ).request( 'add:saveFilter', this.formContentSave, 4, this );\n\t\t\tnfRadio.channel( 'formContent' ).request( 'add:loadFilter', this.formContentLoad, 4, this );\n\t\t\n\t\t\t/*\n\t\t\t * In the RC for Ninja Forms, the 'formContent' channel was called 'fieldContents'.\n\t\t\t * This was changed in version 3.0. These radio messages are here to make sure nothing breaks.\n\t\t\t *\n\t\t\t * TODO: Remove this backwards compatibility radio calls.\n\t\t\t */\n\t\t\tnfRadio.channel( 'fieldContents' ).request( 'add:viewFilter', this.getFormContentView, 4, this );\n\t\t\tnfRadio.channel( 'fieldContents' ).request( 'add:saveFilter', this.formContentSave, 4, this );\n\t\t\tnfRadio.channel( 'fieldContents' ).request( 'add:loadFilter', this.formContentLoad, 4, this );\n\t\t},\n\n\t\tgetFormContentView: function( collection ) {\n\t\t\treturn RowCollectionView;\n\t\t},\n\n\t\t/**\n\t\t * When we update our database, set the form setting value of 'formContentData' to our row collection.\n\t\t * To do this, we have to break our row collection down into an object, then remove all the extra field settings\n\t\t * so that we're left with just the field IDs.\n\t\t * \n\t\t * @since  3.0\n\t\t * @return array \n\t\t */\n\t\tformContentSave: function( rowCollection ) {\n\t\t\tvar rows = JSON.parse( JSON.stringify( rowCollection ) );\t\n\t\t\t_.each( rows, function( row, rowIndex ) {\n\t\t\t\t_.each( row.cells, function( cell, cellIndex ) {\n\t\t\t\t\t_.each( cell.fields, function( field, fieldIndex ) {\n\t\t\t\t\t\tif ( field.key ) {\n\t\t\t\t\t\t\trows[ rowIndex ].cells[ cellIndex].fields[ fieldIndex ] = field.key;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\treturn rows;\n\t\t},\n\n\t\t/**\n\t\t * When we load our builder view, we filter the formContentData.\n\t\t * This turns the saved object into a Backbone Collection.\n\t\t *\n\t\t * If we aren't passed any data, then this form hasn't been modified with layouts yet,\n\t\t * so we default to the nfLayouts.rows global variable that is localised for us.\n\t\t * \n\t\t * @since  3.0\n\t\t * @param  array \t\tformContentData \tcurrent value of our formContentData.\n\t\t * @param  bool  \t\tempty\t\t\t\tis this a purposefully empty collection?\n\t\t * @param  array\t\tfields\t\t\t\tfields array to be turned into rows. This is only passed if MP is also active.\n\t\t * @return Backbone.Collection\n\t\t */\n\t\tformContentLoad: function( formContentData, empty, fields ) {\n\t\t\tif ( true === formContentData instanceof RowCollection ) return formContentData;\n\t\t\t\n\t\t\tempty = empty || false;\n\t\t\tfields = fields || false;\n\t\t\tvar rowArray = [];\n\n\t\t\tvar formContentLoadFilters = nfRadio.channel( 'formContent' ).request( 'get:loadFilters' );\n\n\t\t\t/*\n\t\t\t * TODO: Bandaid fix for making sure that we interpret fields correclty when Multi-Part is active.\n\t\t\t * Basically, if MP is active, we don't want to ever use the nfLayouts.rows.\n\t\t\t */\n\t\t\tvar mpEnabled = ( 'undefined' != typeof formContentLoadFilters[1] ) ? true : false;\n\n\t\t\t/*\n\t\t\t * TODO: Bandaid fix for making sure that Layouts can interpret Multi-Part data if Multi-Part is disabled.\n\t\t\t */\n\t\t\tif ( ! mpEnabled && _.isArray( formContentData ) && 0 != _.isArray( formContentData ).length  && 'undefined' != typeof _.first( formContentData ) && 'part' == _.first( formContentData ).type ) {\n\t\t\t\t/* \n\t\t\t\t * Get our layout data from inside MP\n\t\t\t\t */\n\t\t\t\t\n\t\t\t\tformContentData = _.flatten( _.pluck( formContentData, 'formContentData' ) );\n\t\t\t\t_.each( formContentData, function( row, index ) {\n\t\t\t\t\trow.order = index + 1;\n\t\t\t\t}, this );\n\t\t\t}\n\n\t\t\tif ( _.isArray( formContentData ) && 0 != formContentData.length && 'undefined' == typeof formContentData[0].cells ) {\n\t\t\t\t_.each( formContentData, function( key, index ) {\n\t\t\t\t\trowArray.push( {\n\t\t\t\t\t\torder: index,\n\t\t\t\t\t\tcells: [ {\n\t\t\t\t\t\t\torder: 0,\n\t\t\t\t\t\t\tfields: [ key ],\n\t\t\t\t\t\t\twidth: '100'\n\t\t\t\t\t\t} ]\n\t\t\t\t\t} );\n\n\t\t\t\t} );\n\t\t\t} else if ( _.isEmpty( formContentData ) && 'undefined' != typeof nfLayouts && ! mpEnabled ) {\n\t\t\t\trowArray = nfLayouts.rows;\n\t\t\t} else {\n\t\t\t\trowArray = formContentData;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Ensure that our rows don't have any empty fields\n\t\t\t */\n\t\t\trowArray = _.filter( rowArray, function( row ) {\n\t\t\t\t/*\n\t\t\t\t * Check to see if any of our row's cells have a field.\n\t\t\t\t * If it does, return true and move on.\n\t\t\t\t */\n\t\t\t\treturn _.some( row.cells, function( cell ) { \n\t\t\t\t\treturn 1 <= cell.fields.length;\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\treturn new RowCollection( rowArray );\n\t\t}\n\t});\n\n\treturn controller;\n} );\n","var nfRadio = Backbone.Radio;\nrequire( ['controllers/loadContent'], function( LoadContent ) {\n\n\tvar NFLayouts = Marionette.Application.extend( {\n\n\t\tinitialize: function( options ) {\n\t\t\tthis.listenTo( nfRadio.channel( 'app' ), 'after:appStart', this.afterNFLoad );\n\t\t},\n\n\t\tonStart: function() {\n\t\t\tnew LoadContent();\n\t\t},\n\n\t\tafterNFLoad: function( app ) {\n\t\t\tvar builderEl = nfRadio.channel( 'app' ).request( 'get:builderEl' );\n\t\t\tjQuery( builderEl ).addClass( 'layouts' );\n\t\t}\n\t} );\n\n\tvar nfLayouts = new NFLayouts();\n\tnfLayouts.start();\n} );\ndefine(\"main\", function(){});\n\n"]}