forked from extern/egroupware
Add portlet created by context menu to bottom, since mouse position is unknown
This commit is contained in:
parent
b50dc80ee1
commit
b59f661893
@ -104,8 +104,11 @@ app.home = AppJS.extend(
|
|||||||
/**
|
/**
|
||||||
* Add a new portlet from the context menu
|
* Add a new portlet from the context menu
|
||||||
*/
|
*/
|
||||||
add: function(action) {
|
add: function(action, source) {
|
||||||
var attrs = {id: this._create_id()};
|
// Put it in the last row, first column, since the mouse position is unknown
|
||||||
|
var max_row = Math.max.apply(null,$j('div',this.portlet_container.div).map(function() {return $j(this).attr('data-row');}));
|
||||||
|
var attrs = {id: this._create_id(), row: max_row + 1, col: 1};
|
||||||
|
|
||||||
var portlet = et2_createWidget('portlet',attrs, this.portlet_container);
|
var portlet = et2_createWidget('portlet',attrs, this.portlet_container);
|
||||||
portlet.loadingFinished();
|
portlet.loadingFinished();
|
||||||
|
|
||||||
@ -115,7 +118,9 @@ app.home = AppJS.extend(
|
|||||||
// Set up sorting/grid of new portlet
|
// Set up sorting/grid of new portlet
|
||||||
var $portlet_container = $j(this.portlet_container.getDOMNode());
|
var $portlet_container = $j(this.portlet_container.getDOMNode());
|
||||||
$portlet_container.data("gridster").add_widget(
|
$portlet_container.data("gridster").add_widget(
|
||||||
portlet.getDOMNode()
|
portlet.getDOMNode(),
|
||||||
|
this.DEFAULT.WIDTH, this.DEFAULT.HEIGHT,
|
||||||
|
attrs.col, attrs.row
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user