mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-03 13:16:31 -05:00
Working: Editor Functionality, testing function call on object
This commit is contained in:
parent
15c45cc677
commit
632dd68a2f
1 changed files with 9 additions and 3 deletions
|
@ -29,10 +29,16 @@ $(document).ready(function () {
|
||||||
$(div).load(buildPath + 'Squire-UI.html', function () {
|
$(div).load(buildPath + 'Squire-UI.html', function () {
|
||||||
$('.item').click(function () {
|
$('.item').click(function () {
|
||||||
var me = $(this);
|
var me = $(this);
|
||||||
|
|
||||||
var iFrame = me.parents('.Squire-UI').next('iframe').first()[0];
|
var iFrame = me.parents('.Squire-UI').next('iframe').first()[0];
|
||||||
var editor = iFrame.contentWindow.document;
|
editor = iFrame.contentWindow.document;
|
||||||
var action = me.data('action');
|
console.log(me.data('action'), me.data('value'));
|
||||||
console.log(editor, action);
|
try {
|
||||||
|
editor[me.data('action')](me.data('value'));
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue