Skip to content

Commit d68b28a

Browse files
committed
allow slashes in involvement slugs
1 parent 803e783 commit d68b28a

2 files changed

Lines changed: 1 addition & 22 deletions

File tree

src/templates/admin/invKoForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ function initInvVm() {
394394
read: target,
395395
write: function(newValue) {
396396
let current = target();
397-
newValue = newValue.toLowerCase().replaceAll(/([^a-z0-9]+)+/g, '-')
397+
newValue = newValue.toLowerCase().replaceAll(/([^a-z0-9/]+)+/g, '-')
398398

399399
//only write if it changed
400400
if (newValue !== current) {

src/templates/admin/locationsKoForm.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -118,27 +118,6 @@ function LocationsVM(locationData) {
118118
}
119119

120120
function initLocationVM() {
121-
// noinspection JSUnusedLocalSymbols
122-
ko.extenders.slug = function(target, option) {
123-
let result = ko.pureComputed({
124-
read: target,
125-
write: function(newValue) {
126-
let current = target();
127-
newValue = newValue.toLowerCase().replaceAll(/([^a-z0-9/]+)+/g, '-')
128-
129-
//only write if it changed
130-
if (newValue !== current) {
131-
target(newValue);
132-
}
133-
}
134-
}).extend({ notify: 'always' });
135-
136-
//initialize
137-
result(target());
138-
139-
return result;
140-
}
141-
142121
let formElt = document.getElementById('locations_json'),
143122
locationData = JSON.parse(formElt.innerText);
144123
tpvm._vmContext.locationsVM = new LocationsVM(locationData)

0 commit comments

Comments
 (0)