Comparing version 1.0.1 to 1.1.0
import { $ } from '../queryjs'; | ||
import { camelCaseToDash } from '../hummingbird/lib/string'; | ||
import { callWatchFunctions } from './syncData'; | ||
import { callSaveFunction } from './onSave'; | ||
@@ -15,2 +16,6 @@ export default function () { | ||
setValue({elem: event.currentTarget, keyName, attributeValue}); | ||
if (event.currentTarget.getAttribute("data-i") === "triggerSaveOnChange") { | ||
callSaveFunction({targetElement: event.currentTarget}); | ||
} | ||
}); | ||
@@ -26,2 +31,6 @@ | ||
setValue({elem: event.currentTarget, keyName, attributeValue: "true", toggleValue: true}); | ||
if (event.currentTarget.getAttribute("data-i") === "triggerSaveOnChange") { | ||
callSaveFunction({targetElement: event.currentTarget}); | ||
} | ||
}) | ||
@@ -37,2 +46,6 @@ | ||
setValue({elem: event.currentTarget, keyName, attributeValue}); | ||
if (event.currentTarget.getAttribute("data-i") === "triggerSaveOnChange") { | ||
callSaveFunction({targetElement: event.currentTarget}); | ||
} | ||
}); | ||
@@ -49,2 +62,6 @@ | ||
setValue({elem: event.currentTarget, keyName, attributeValue}); | ||
if (event.currentTarget.getAttribute("data-i") === "triggerSaveOnChange") { | ||
callSaveFunction({targetElement: event.currentTarget}); | ||
} | ||
}); | ||
@@ -51,0 +68,0 @@ |
import { $ } from '../queryjs'; | ||
import { camelCaseToDash } from '../hummingbird/lib/string'; | ||
import { callWatchFunctions } from "./syncData"; | ||
import { callSaveFunction } from './onSave'; | ||
@@ -8,3 +9,4 @@ export default function () { | ||
// <input> and <textarea> | ||
$.on("input", "input[data-i], textarea[data-i]", function (event) { | ||
// IMPORTANT: This is ONLY for text inputs, not radio, select, or checkboxes | ||
$.on("input", "input[type='text'][data-i], textarea[data-i]", function (event) { | ||
// 2. get the key name inside the name attribute | ||
@@ -31,4 +33,8 @@ let camelCaseKeyName = event.currentTarget.getAttribute("name"); | ||
}); | ||
if (event.currentTarget.getAttribute("data-i") === "triggerSaveOnChange") { | ||
callSaveFunction({targetElement: event.currentTarget}); | ||
} | ||
}); | ||
} |
@@ -5,2 +5,4 @@ import { getDataAndDataSourceElemFromNodeAndAncestors, setValueForKeyName } from "../outputjs"; | ||
// this is fed a save callback function when inputjs in initialized | ||
let afterSyncCallbacks = []; | ||
@@ -11,2 +13,10 @@ export function afterSync (cb) { | ||
// syncDataBetweenElements | ||
// 1. get the data | ||
// 2. loop through the keys | ||
// 3. sync data from keys into targetElement (looking through ancestors) | ||
// 4. call all watch functions inside where the data was synced into | ||
// 5. syncs data into input elements if they're inside the element that was synced into | ||
// 6. the afterSyncCallbacks are called | ||
// *** THIS INCLUDES A SAVE FUNCTION DEFINED WHEN REMAKE IS INITIALIZED *** | ||
export function syncDataBetweenElements ({sourceElement, targetElement, shouldTriggerSave}) { | ||
@@ -53,3 +63,3 @@ | ||
// make sure data sync happens after all date is in place | ||
// make sure data sync happens after all data is in place | ||
// e.g. we might want to have the switch action button also set data | ||
@@ -56,0 +66,0 @@ // (we currently do this with the inline edit revisions submit button) |
{ | ||
"text": "Hello" | ||
"todo": { | ||
"text": "Hello" | ||
} | ||
} |
import Remake from '../../../_remake/client-side'; | ||
import './helpers/event-helpers'; | ||
import crostini from 'crostini'; | ||
@@ -3,0 +4,0 @@ |
{ | ||
"name": "remake", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Generate a full-stack Remake web app", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
533990
82
13053
2