Author: nathangray
New Revision: 55355
URL: http://svn.stylite.de/viewvc/egroupware?rev=55355&view=rev
Log:
Taglist fixes:
- Fix toggle multiple got stuck with single value
- Fix keyboard navigation
Modified:
trunk/etemplate/inc/class.etemplate_widget_taglist.inc.php
trunk/etemplate/js/et2_widget_taglist.js
— trunk/etemplate/inc/class.etemplate_widget_taglist.inc.php (original)
+++ trunk/etemplate/inc/class.etemplate_widget_taglist.inc.php Thu Mar 10 18:44:51 2016
@@ -107,7 +107,7 @@
foreach((array) $value as $key => $val)
{
-
if(count($allowed) && !$this->attrs['allowFreeEntries'] && !array_key_exists($val,$allowed))
{
self::set_validation_error($form_name,lang("'%1' is NOT allowed ('%2')!",$val,implode("','",array_keys($allowed))),'');
unset($value[$key]);
@@ -132,6 +132,10 @@
{
self::set_validation_error($form_name,lang(‘Field must not be empty !!!’,$value),’’);
}
-
if($this->attrs['multiple'] == false)
-
{
-
$value = array_shift($value);
-
}
$valid =& self::get_array($validated, $form_name, true);
// returning null instead of array(), as array() will be overwritten by etemplate_new::complete_array_merge()
// with preserved old content and therefore user can not empty a taglist
— trunk/etemplate/js/et2_widget_taglist.js (original)
+++ trunk/etemplate/js/et2_widget_taglist.js Thu Mar 10 18:44:51 2016
@@ -277,6 +277,20 @@
$j(’.egw_tooltip’).hide();
widget.div.addClass(‘ui-state-active’);
})
-
// If not using autoSelect, avoid some errors with selection starting
-
// with the group
-
.on('load expand', function() {
-
if(widget.taglist && widget.taglist_options.groupBy)
-
{
-
window.setTimeout(function() {
-
if(widget && widget.taglist.combobox)
-
{
-
widget.taglist.combobox.find('.ms-res-group.ms-res-item-active')
-
.removeClass('ms-res-item-active');
-
}
-
},1);
-
}
-
})
// Position absolute to break out of containers
.on('expand', jQuery.proxy(function(c) {
var taglist = this.taglist;
@@ -714,11 +728,14 @@
if(this.taglist == null) return;
-
// Switch to multiple if allowed and more than 1 value
-
var multiple = this.options.multiple ? values.length > 1 : false;
-
if(multiple !== this._multiple)
-
{
-
this._set_multiple(multiple);
-
// Switch multiple according to attribute and more than 1 value
-
if(this.options.multiple !== true)
-
{
-
var multiple = this.options.multiple ? values.length > 1 : false;
-
if(multiple !== this._multiple)
-
{
-
this._set_multiple(multiple);
-
}
}
this.taglist.clear(true);
@@ -785,8 +802,7 @@
},
},
lib_options: {
-
minChars: 2,
-
toggleOnClick: true
-
toggleOnClick: true
},
init: function() {
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs