Skip to content
Permalink
Browse files

remove ability to have `appName`

  • Loading branch information...
panphora committed Aug 12, 2019
1 parent 07453df commit 18c0f3ec7150bc31dbb5e4f0ae5ab7aa9c6c81b7
Showing with 6 additions and 12 deletions.
  1. +1 −1 dist/bundle.cjs.js
  2. +3 −7 dist/bundle.es6.js
  3. +1 −2 src/inputjs/addingItemEventListener.js
  4. +1 −2 src/inputjs/onSave.js

Large diffs are not rendered by default.

@@ -2162,12 +2162,10 @@ var saveFunctionsLookup = {
path = _ref.path,
saveToId = _ref.saveToId,
elem = _ref.elem;
var appName = $$1("body").get(0).getAttribute("data-app");
ajaxPost("/save", {
data: data,
path: path,
saveToId: saveToId,
appName: appName
saveToId: saveToId
}, function (res) {});
}
};
@@ -2809,13 +2807,11 @@ function initAddingItemEventListener () {
_getAttributeValueAsA2 = _slicedToArray(_getAttributeValueAsA, 3),
templateName = _getAttributeValueAsA2[0],
selector = _getAttributeValueAsA2[1],
position = _getAttributeValueAsA2[2];
position = _getAttributeValueAsA2[2]; // pass the template name into an endpoint and get the resulting html back

var appName = $$1("body").get(0).getAttribute("data-app"); // pass the template name into an endpoint and get the resulting html back

ajaxPost("/new", {
templateName: templateName,
appName: appName
templateName: templateName
}, function (res) {
var htmlString = res.htmlString; // find the closest element matching the selector

@@ -12,10 +12,9 @@ export default function () {

// parse the data attribute to get the selector and the template name
let [templateName, selector, position] = getAttributeValueAsArray(triggerElem, "data-i-new");
let appName = $("body").get(0).getAttribute("data-app");

// pass the template name into an endpoint and get the resulting html back
ajaxPost("/new", {templateName, appName}, function (res) {
ajaxPost("/new", {templateName}, function (res) {
let {htmlString} = res;

// find the closest element matching the selector
@@ -6,8 +6,7 @@ import { getAttributeValueAsArray } from '../parse-data-attributes';
let saveFunctionsLookup = {
// default save function posts data to /save endpoint
defaultSave: function ({data, path, saveToId, elem}) {
let appName = $("body").get(0).getAttribute("data-app");
ajaxPost("/save", {data, path, saveToId, appName}, function (res) {});
ajaxPost("/save", {data, path, saveToId}, function (res) {});
}
};

0 comments on commit 18c0f3e

Please sign in to comment.
You can’t perform that action at this time.