[Mapbender-commits] r5763 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Sun Mar 14 11:05:45 EDT 2010
Author: verenadiewald
Date: 2010-03-14 11:05:44 -0400 (Sun, 14 Mar 2010)
New Revision: 5763
Modified:
trunk/mapbender/http/javascripts/mod_ResultList.js
Log:
trigger for mouseover and mouseout, class for resultList div
Modified: trunk/mapbender/http/javascripts/mod_ResultList.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_ResultList.js 2010-03-14 15:04:42 UTC (rev 5762)
+++ trunk/mapbender/http/javascripts/mod_ResultList.js 2010-03-14 15:05:44 UTC (rev 5763)
@@ -18,20 +18,10 @@
* > ../../lib/resultGeometryListModel.js','','','');
* >
* > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
- * > VALUES('<app_id>', 'resultList', 'infoPopupHeight', '250', '' ,'var');
+ * > VALUES('<app_id>', 'resultList', 'resultListTitle', 'Search results', 'title of the result list dialog', 'var');
* > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
- * > VALUES('<app_id>', 'resultList', 'infoPopupWidth', '400', '' ,'var');
+ * > VALUES('<app_id>', 'resultList', 'resultListHeight', '250', 'height of the result list dialog' ,'var');
* > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
- * > VALUES('<app_id>', 'resultList', 'maxHighlightedPoints', '500', '' ,'var');
- * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
- * > VALUES('<app_id>', 'resultList', 'resultHighlightColor', '#ff0000', '' ,'var');
- * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
- * > VALUES('<app_id>', 'resultList', 'resultHighlightLineWidth', '2', '' ,'var');
- * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
- * > VALUES('<app_id>', 'resultList', 'resultHighlightZIndex', '100', '' ,'var');
- * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
- * > VALUES('<app_id>', 'resultList', 'resultListTitle', 'Search results', 'title of the result list dialog', 'var');
- * > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
* > VALUES('<app_id>', 'resultList', 'resultListWidth', '800', 'width of the result list dialog' ,'var');
* > INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
* > VALUES('<app_id>', 'resultList', 'position', '[200,200]', 'position of the result list dialog' ,'var');
@@ -43,14 +33,10 @@
* http://www.mapbender.org/User:Karim Malhas
*
* Parameters:
- * infoPopupHeight - *[optional]* height of the resultList dialog
- * infoPopupWidth - *[optional]* width of the resultList dialog
- * maxHighlightedPoints - *[optional]* maximum number of points of a geometry that can be highlighted in the client
- * resultHighlightColor - *[optional]* color of the resultHighlighting
- * resultHighlightLineWidth - *[optional]* line width of the resultHighlighting
- * resultHighlightZIndex - *[optional]* zindex of the resultHighlighting
* resultListTitle - *[optional]* title of the resultList dialog
- * position - *[optional]* set the position of the resultList dialog
+ * resultListHeight - *[optional]* height of the resultList dialog
+ * resultListWidth - *[optional]* width of the resultList dialog
+ * position - *[optional]* position of the result list detail popup
*
*
* License:
@@ -62,17 +48,12 @@
//check element vars
var display_popup = display_popup || true;
+options.resultListTitle = options.resultListTitle || "ResultList";
options.infoPopupHeight = options.infoPopupHeight || 250;
options.infoPopupWidth = options.infoPopupWidth || 400;
-options.maxHighlightedPoints = options.maxHighlightedPoints || 5;
-options.resultHighlightColor = options.resultHighlightColor || "#ff0000";
-options.resultHighlightZIndex = options.resultHighlightZIndex || 100;
-options.resultHighlightLineWidth = options.resultHighlightLineWidth || 2;
-options.resultListTitle = options.resultListTitle || "ResultList";
// see http://docs.jquery.com/UI/Dialog for possible values
options.position = options.position || 'center';
-
var ResultGeometryList = function(){
//store a callback for the function to call when a row is clicke
var row_callback = function(){};
@@ -81,7 +62,9 @@
me.options = options;
me.rowclick = new Mapbender.Event();
-
+ me.rowmouseover = new Mapbender.Event();
+ me.rowmouseout = new Mapbender.Event();
+
/*
* Method: addGlobalButton
* Descriptions: adds a Button to the bottom of the resultList
@@ -154,7 +137,12 @@
* title - {String} the new title of the resultList
*/
this.setTitle = function(title){
- $('#'+options.id).data("title.dialog",title);
+ if(options.resultListTitle == 'ResultList') {
+ $('#'+options.id).data("title.dialog",title);
+ }
+ else {
+ $('#'+options.id).data("title.dialog",options.resultListTitle);
+ }
};
/*
@@ -176,23 +164,15 @@
};
this.show = function(){
-
- me.resultHighlight = new Highlight(
- options.target,
- "resultListHighlight",
- {"position":"absolute", "top":"0px", "left":"0px", "z-index":options.resultHighlightZIndex},
- options.resultHighlightLineWidth);
- if(display_popup){
+ $('#'+options.id).addClass("resultList");
+
+ if(display_popup) {
$('#'+options.id).dialog("open");
- }else{
+ }
+ else {
$('#'+options.id).css("display","block");
}
- me.resultHighlight = new Highlight(
- options.target,
- "resultListHighlight",
- {"position":"absolute", "top":"0px", "left":"0px", "z-index":options.resultHighlightZIndex},
- options.resultHighlightLineWidth);
var rowNodes = me.datatable.fnGetNodes();
for (rowNodeIndex in rowNodes){
(function() {
@@ -201,29 +181,15 @@
me.rowclick.trigger((function(){return row;})());
});
-
- $(row).mouseover(function () {
- var i = $(this).data("modelindex");
- var feature = me.model.getFeature(i);
-
- if (options.maxHighlightedPoints > 0 && feature.getTotalPointCount() > options.maxHighlightedPoints) {
- feature = feature.getBBox4();
- }
-
- me.resultHighlight.add(feature, options.resultHighlightColor);
- me.resultHighlight.paint();
- }).mouseout(function () {
- var i = $(this).data("modelindex");
- var feature = me.model.getFeature(i);
-
- if (options.maxHighlightedPoints > 0 && feature.getTotalPointCount() > options.maxHighlightedPoints) {
- feature = feature.getBBox4();
- }
-
- me.resultHighlight.del(feature, options.resultHighlightColor);
- me.resultHighlight.paint();
+ $(".wfsFproperty", row).mouseover(function(){
+ me.rowmouseover.trigger((function(){return row;})());
});
- // make rows selectable only when there are Global Buttons that could actually do womething with that selection
+
+ $(".wfsFproperty", row).mouseout(function(){
+ me.rowmouseout.trigger((function(){return row;})());
+ });
+
+ // make rows selectable only when there are Global Buttons that could actually do something with that selection
if($('#'+options.id+"buttonrow").length > 0){
$(row).click((function(){
if($(this).hasClass('row_selected')){
@@ -240,8 +206,6 @@
})();
}
-
-
};
this.hide = function(){
@@ -254,7 +218,7 @@
};
if(display_popup){
- $('#'+options.id).dialog({autoOpen: false , width:600, draggable: true, title: options.resultListTitle, position: options.position});
+ $('#'+options.id).dialog({autoOpen: false , width:options.resultListWidth, height:options.resultListHeight, draggable: true, title: options.resultListTitle, position: options.position});
}
else{
$('#'+options.id).css("display","none");
@@ -262,12 +226,9 @@
};
-
ResultGeometryList.prototype = new ResultGeometryListController(options);
ResultGeometryList.prototype.constructor = ResultGeometryList;
-
-
Mapbender.modules[options.id] = $.extend(
new ResultGeometryList(), Mapbender.modules[options.id]
);
More information about the Mapbender_commits
mailing list