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

index_gadget: load content

parent 20834ef4
/*jslint indent: 2 */
/*global EventEmitter, RSVP, jIO */
(function (window, rJS,$) {
(function (window, rJS,$, RSVP) {
/**
* Web site configurations
*/
var gk = rJS(window);
/* Initialize Page List */
gk.declareMethod('setDocumentList', function (document_list) {
gk.declareMethod('setDocumentList', function (document_list, editor, editor_callback, property, property_callback) {
var i,
document,
index_list_panel = $('#index_list');
......@@ -17,11 +17,12 @@
"<li><a href=#>"
+ document.title
+ "</a></li>");
//panel_context.find('a').last().click(
// createLoadNewBlogCallback(
// g, blog_definition.path,
// blog_a_context, io_list[0].path, io_blog_a_context)
// );
index_list_panel.find('a').last().click(function(){
RSVP.all([
editor_callback.apply(editor,[document.text_content]),
property_callback.apply(property, [document])
])}
);
}
});
}(window, rJS, jQuery));
\ No newline at end of file
}(window, rJS, jQuery, RSVP));
\ No newline at end of file
......@@ -17,7 +17,7 @@
$(editor.element).trigger('create');
return io.configureIO(jio_config)
.then(function () {
return io.configureDataSourceCallback(editor, editor.getContent, property, property.getContent ,'48c3ca06-78b9-2f4c-80db-d5cb2417de45');
return ;
})
.then(function () {
return io.getIOList().fail(function (error) {
......@@ -32,7 +32,14 @@
return RSVP.all([
editor.setContent(document_list[0].doc.text_content),
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