Commit cb939431 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

index_gadget: load content

parent 20834ef4
/*jslint indent: 2 */ /*jslint indent: 2 */
/*global EventEmitter, RSVP, jIO */ /*global EventEmitter, RSVP, jIO */
(function (window, rJS,$) { (function (window, rJS,$, RSVP) {
/** /**
* Web site configurations * Web site configurations
*/ */
var gk = rJS(window); var gk = rJS(window);
/* Initialize Page List */ /* Initialize Page List */
gk.declareMethod('setDocumentList', function (document_list) { gk.declareMethod('setDocumentList', function (document_list, editor, editor_callback, property, property_callback) {
var i, var i,
document, document,
index_list_panel = $('#index_list'); index_list_panel = $('#index_list');
...@@ -17,11 +17,12 @@ ...@@ -17,11 +17,12 @@
"<li><a href=#>" "<li><a href=#>"
+ document.title + document.title
+ "</a></li>"); + "</a></li>");
//panel_context.find('a').last().click( index_list_panel.find('a').last().click(function(){
// createLoadNewBlogCallback( RSVP.all([
// g, blog_definition.path, editor_callback.apply(editor,[document.text_content]),
// blog_a_context, io_list[0].path, io_blog_a_context) property_callback.apply(property, [document])
// ); ])}
);
} }
}); });
}(window, rJS, jQuery)); }(window, rJS, jQuery, RSVP));
\ No newline at end of file \ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
$(editor.element).trigger('create'); $(editor.element).trigger('create');
return io.configureIO(jio_config) return io.configureIO(jio_config)
.then(function () { .then(function () {
return io.configureDataSourceCallback(editor, editor.getContent, property, property.getContent ,'48c3ca06-78b9-2f4c-80db-d5cb2417de45'); return ;
}) })
.then(function () { .then(function () {
return io.getIOList().fail(function (error) { return io.getIOList().fail(function (error) {
...@@ -32,7 +32,14 @@ ...@@ -32,7 +32,14 @@
return RSVP.all([ return RSVP.all([
editor.setContent(document_list[0].doc.text_content), editor.setContent(document_list[0].doc.text_content),
property.setContent(document_list[0].doc), property.setContent(document_list[0].doc),
index.setDocumentList(document_list) index.setDocumentList(
document_list,
editor, editor.setContent,
property, property.setContent),
io.configureDataSourceCallback(
editor, editor.getContent,
property, property.getContent ,
document_list[0].id)
]); ]);
}); });
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment