diff --git a/src/css/builder.css b/src/css/builder.css index c9aa4526..3df58d2e 100644 --- a/src/css/builder.css +++ b/src/css/builder.css @@ -774,6 +774,46 @@ body.ui-tabs.ui-widget { border-radius: 6px; text-decoration: none; } +.propertyView .droplist { + background: #fff; + border-top: 0; + top: 27px; + left: 0; + -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15); + z-index: 999; + width: 100%; + border-radius: 0 0 5px 5px; + padding: 0px 5px; +} +.propertyView .droplist li { + clear:both; + cursor: pointer; + line-height: 80%; + padding: 7px 0px 8px; + margin: 0; + list-style: none; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white)); + background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%); +} +.propertyView .droplist li:hover { + background-image: none; + background-color:#b0c4de; +} +.propertyView .droplist > ul { + list-style-type: none ; + margin: 0 4px 4px 0; + max-height: 200px; + padding: 0px; + position: relative; + overflow-x: hidden; + overflow-y: auto; +} +.propertyView .datalist-input { + border-radius: 5px 5px 0px 0px; + outline-color: #E59700; + outline-style: auto; + outline-width: 5px; +} .propertyView .buttonStyle:focus, .propertyView .buttonStyle:hover { color: #eee; diff --git a/src/js/views/property.js b/src/js/views/property.js index 6be0924a..b763b256 100644 --- a/src/js/views/property.js +++ b/src/js/views/property.js @@ -294,6 +294,53 @@ }, }); break; + case "datalist": + $('
') + .append( + $('') + .attr('id', valueId) + .addClass('labelInput') + .click({'p': p, 'value': value}, function(e){ + var o, value = e.data.value, p = e.data.p; + value.find('ul').html(""); + for(o in options[p]) { + $('
  • ' + options[p][o] + '
  • ').appendTo(value.find('ul')); + } + $(this).toggleClass('datalist-input'); + value.find('.droplist').toggle(); + return false; + }) + .keyup({ 'p' : p, 'value' : value}, function(e){ + var matchedOptions = [], o, + inputedText = this.value, + value = e.data.value; + matchedOptions = $.grep(options[e.data.p], function(item, i){ + return item.indexOf(inputedText) >= 0; + }); + value.find('ul').html(""); + + for (o in matchedOptions) { + $('
  • ' + matchedOptions[o] + '
  • ') + .appendTo(value.find('ul')); + } + $(this).addClass('datalist-input'); + value.find('.droplist').show(); + }) + ) + .append( + $('
    ') + .addClass('droplist') + .append('