summaryrefslogtreecommitdiff
path: root/addons/web_dashboard/static/src/js/dashboard.js
diff options
context:
space:
mode:
authorJigar Amin - OpenERP <jam@tinyerp.com>2012-06-08 14:54:04 +0530
committerJigar Amin - OpenERP <jam@tinyerp.com>2012-06-08 14:54:04 +0530
commit2b2b1ec41b09e573e1cec5476de32ad81a60309b (patch)
tree2229405cacf9d3e78d0373b364ccd9a4393525a5 /addons/web_dashboard/static/src/js/dashboard.js
parenteb5588db081e15212c413760943e5b7996dda88e (diff)
[IMP] imporved code
bzr revid: jam@tinyerp.com-20120608092404-p5832c093dbkwzna
Diffstat (limited to 'addons/web_dashboard/static/src/js/dashboard.js')
-rw-r--r--addons/web_dashboard/static/src/js/dashboard.js17
1 files changed, 6 insertions, 11 deletions
diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js
index 8b8d34c6368..42fde360d72 100644
--- a/addons/web_dashboard/static/src/js/dashboard.js
+++ b/addons/web_dashboard/static/src/js/dashboard.js
@@ -232,14 +232,13 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({
},
renderElement: function() {
var self = this;
- //to Check dash contains any action if not then show the action help
- var array= [];
- _.each(this.node.children, function(column, column_index) {
- array.push(_.include(_.pluck(column.children,"tag"),"action"));
+ var check = _.detect(this.node.children, function(column, column_index) {
+ return _.detect(column.children,function(element){
+ return element.tag === "action"? element: false;
+ });
});
- if (! _.include(array,true)){
+ if (!check)
return self.no_result();
- }
// We should start with three columns available
for (var i = this.node.children.length; i < 3; i++) {
this.node.children.push({
@@ -252,14 +251,10 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({
this.$element.html(rendered);
},
no_result: function () {
- if (!this.view.options.action
- || !this.view.options.action.help) {
- return;
- }
this.$element.prepend(
$('<div class="oe_view_nocontent">')
.append($('<img>', { src: '/web_dashboard/static/src/img/view_todo_arrow.png' }))
- .append($('<div>').html(this.view.options.action.help))
+ .append($('<div>').html(this.view.options.action.help || " "))
);
},
do_reload: function() {