From e18bb959beaa7675ea5b5d611f527c478dd1361c Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Thu, 31 Mar 2011 01:55:52 +0200 Subject: [PATCH] playing with folding, lends will be removed (can be added by preprocessing) bzr revid: al@openerp.com-20110330235552-06z58n5vcbzwmst5 --- addons/base/static/src/js/data.js | 24 ++++++++++++++++-------- addons/base/static/src/js/views.js | 10 ++++------ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/addons/base/static/src/js/data.js b/addons/base/static/src/js/data.js index 41bb31b6847..d294ca8d8b9 100644 --- a/addons/base/static/src/js/data.js +++ b/addons/base/static/src/js/data.js @@ -1,18 +1,17 @@ openerp.base.data = function(openerp) { -/** - * Management interface between views and the collection of selected OpenERP - * records (represents the view's state?) - */ openerp.base.DataGroup = openerp.base.Controller.extend({ + /** + * Management interface between views and the collection of selected OpenERP + * records (represents the view's state?) + */ init: function(session) { this._super(session, null); }, }); -openerp.base.DataSet = openerp.base.Controller.extend( - /** @lends openerp.base.DataSet# */{ +openerp.base.DataSet = openerp.base.Controller.extend( /** @lends openerp.base.DataSet# */{ /** * Management interface between views and the collection of selected @@ -102,7 +101,8 @@ openerp.base.DataSet = openerp.base.Controller.extend( * @param {Object} event.context the context set on the DataSet before DataSet#fetch was called * @param {Array} event.sort the sorting criteria used to get the ids */ - on_fetch: function (records, event) { }, + on_fetch: function (records, event) { + }, /** * Fetch all the currently active records for this DataSet (records selected via DataSet#select) @@ -125,6 +125,7 @@ openerp.base.DataSet = openerp.base.Controller.extend( }, this)); return this; }, + /** * Fires after the DataSet fetched the records matching its internal active ids selection * @@ -133,7 +134,8 @@ openerp.base.DataSet = openerp.base.Controller.extend( * @event * @param {Array} records An array of the DataRecord fetched */ - on_active_ids: function (records) { }, + on_active_ids: function (records) { + }, /** * Fetches the current active record for this DataSet @@ -155,6 +157,7 @@ openerp.base.DataSet = openerp.base.Controller.extend( }, this)); return this; }, + /** * Fires after the DataSet fetched the record matching the current active record * @@ -198,6 +201,7 @@ openerp.base.DataSet = openerp.base.Controller.extend( } return this; }, + /** * Activates the next id in the active sequence. If there is no next id, wraps around to the first one * @returns itself @@ -225,12 +229,14 @@ openerp.base.DataSet = openerp.base.Controller.extend( this._active_id_index = 0; return this; }, + /** * Fetches the ids of the currently selected records, if any. */ get_active_ids: function () { return this._active_ids; }, + /** * Sets the current active_id by value * @@ -256,6 +262,7 @@ openerp.base.DataSet = openerp.base.Controller.extend( } return this; }, + /** * Fetches the id of the current active record, if any. * @@ -282,6 +289,7 @@ openerp.base.DataRecord = openerp.base.Controller.extend({ on_reload: function() { } }); + }; // vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: diff --git a/addons/base/static/src/js/views.js b/addons/base/static/src/js/views.js index a34fa2254d7..a41f79269e4 100644 --- a/addons/base/static/src/js/views.js +++ b/addons/base/static/src/js/views.js @@ -139,10 +139,6 @@ openerp.base.ViewManagerRoot = openerp.base.Controller.extend({ openerp.base.ViewManagerUsedAsAMany2One = openerp.base.Controller.extend({ }); -/** - * Base class for widgets. Handle rendering (based on a QWeb template), identifier - * generation, parenting and destruction of the widget. - */ openerp.base.BaseWidget = openerp.base.Controller.extend({ /** * The name of the QWeb template that will be used for rendering. Must be redifined @@ -159,6 +155,8 @@ openerp.base.BaseWidget = openerp.base.Controller.extend({ */ identifier_prefix: 'generic-identifier', /** + * Base class for widgets. Handle rendering (based on a QWeb template), identifier + * generation, parenting and destruction of the widget. * Contructor. Also initialize the identifier. * * @params {openerp.base.search.BaseWidget} parent The parent widget. @@ -227,10 +225,10 @@ openerp.base.BaseWidget = openerp.base.Controller.extend({ * @param {object} additional Additional context arguments to pass to the template. */ render: function (additional) { - return QWeb.render(this.template, _.extend({}, this, - additional != null ? additional : {})); + return QWeb.render(this.template, _.extend({}, this, additional != null ? additional : {})); } }); + openerp.base.CalendarView = openerp.base.Controller.extend({ // Dhtmlx scheduler ? });