projects
/
infodrom.org
/
service.infodrom.org
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3179189
)
jquery-editable: Automatically call backend if route and id attributes are present
author
Joey Schulze
<joey@infodrom.org>
Mon, 17 Jul 2017 21:06:49 +0000
(23:06 +0200)
committer
Joey Schulze
<joey@infodrom.org>
Mon, 17 Jul 2017 21:06:49 +0000
(23:06 +0200)
src/jquery.editable.js
patch
|
blob
|
history
diff --git
a/src/jquery.editable.js
b/src/jquery.editable.js
index
406b3db
..
d091608
100644
(file)
--- a/
src/jquery.editable.js
+++ b/
src/jquery.editable.js
@@
-173,6
+173,16
@@
$el : $el
});
}
$el : $el
});
}
+ else {
+ var route = $($el).attr('route');
+ var name = $($el).attr('name');
+ var item_id = $($el).attr('item_id');
+ if (typeof(route) == 'string' && typeof(item_id) == 'string')
+ $.invoke(route,
+ {id: item_id,
+ name: name,
+ content: newText == defaultText ? false : newText});
+ }
};
// Blur editor when user clicks outside the editor
};
// Blur editor when user clicks outside the editor
@@
-237,6
+247,16
@@
$el : $el
});
}
$el : $el
});
}
+ else {
+ var route = $($el).attr('route');
+ var name = $($el).attr('name');
+ var item_id = $($el).attr('item_id');
+ if (typeof(route) == 'string' && typeof(item_id) == 'string')
+ $.invoke(route,
+ {id: item_id,
+ name: name,
+ content: newText == defaultText ? false : newText});
+ }
})
.attr('style', textareaStyle)
.appendTo($el)
})
.attr('style', textareaStyle)
.appendTo($el)