duplicate error fixed and css inside widgets fixed, duplicate location fixed

This commit is contained in:
harrybomrah authored and saurabhbhatia committed 2013-07-30 16:41:44 +08:00
1 parent dc94283af9
commit ae8033ea1b
5 files changed
+69 -219

No files matched your search

+57 -32
View File
@@ -6,7 +6,8 @@
//container=true is the area where the view will be loaded
//load = true is used to load the submenu item by default
//response-type = "json"|"script"|"xml|html" default is json
//autocomplete-list = "listname" an array from which autocomplete will be attached to its respective input or textarea
//autocomplete = "url" this will automatically convert textarea or input to autocomplete.
//autocomplete-format = "--:[text,email]" first one is seperator which will be put on between every field.
//ajax-remote="get/delete/post/false" this will automatically bind the <a> with remote ajax call. By default if the resposne is html, it ll be inserted in container=true, false option will not make any calls and also stop page refresh
// content-holder = "jquery dom", the returned html of server will be put inside the dom mentioned in content-holder of a tag. this can be used in a tags as attributes
//confirm-message ="Some message", this will prompt user with a confirm box and show the message before ajax call is made.
@@ -342,38 +343,13 @@ var orbitDesktop = function(dom){
return split( term ).pop();
}
var autocompleteListName = null;
$("body").on("keydown","*[autocomplete-list]", function( event ) {
autocompleteListName = $(this).attr("autocomplete-list");
if ( event.keyCode === $.ui.keyCode.TAB &&
$( this ).data( "autocomplete" ).menu.active ) {
event.preventDefault();
}
$(this).autocomplete({
minLength: 0,
source: function( request, response ) {
// delegate back to autocomplete, but extract the last term
response( $.ui.autocomplete.filter(
window.o[o.data_method][autocompleteListName], extractLast( request.term ) ) );
},
focus: function() {
// prevent value inserted on focus
return false;
},
select: function( event, ui ) {
var terms = split( this.value );
// remove the current input
terms.pop();
// add the selected item
terms.push( ui.item.value );
// add placeholder to get the comma-and-space at the end
terms.push( "" );
this.value = terms.join( ", " );
return false;
}
});
});
// $("body").on("keydown","*[autocomplete]", function( event ) {
// var autocompleteList = $(this).attr("autocomplete-list");
// console.log($(this));
// });
//
};
this.layout_data = function(h){
@@ -466,6 +442,8 @@ var orbitDesktop = function(dom){
}
}
o.tinyscrollbar_ext(settings,tsettings);
o.autocomplete();
o.use_select2();
}
this.paging = true;
this.pagination = function(link,variable,page_no){
@@ -1611,6 +1589,53 @@ var orbitDesktop = function(dom){
// minimumInputLength: -1
});
}
this.autocomplete = function(){
$("*[autocomplete]").each(function(){
$e = $(this);
var options = {
multiple:true,
minimumInputLength: -1,
width: "off",
ajax: {
url: $e.attr("autocomplete"),
dataType: 'json',
quietMillis: 100,
tokenSeparators: [","],
data: function (search, page) {
return {q: search};
},
results: function (data, page) {
return {results: data.results};
}
}
}
var format = $e.attr("autocomplete-format");
if(format){
format = format.split(":");
var seperator = format[0];
var fields = format[1];
fields = fields.replace("]","");
fields = fields.replace("[","");
fields = fields.split(",");
options.formatResult = function(data){
var markup = "";
var x = 0;
for(i in fields){
if(x > 0)markup += " " + seperator + " ";
x++;
if(data[fields[i]])
markup += data[fields[i]];
else
markup += fields[i] + " not available";
}
return markup;
}
}
$e.select2(options);
})
}
this.appname_substr = function(target,length){
var $target = $(target),
length = (length && typeof length == 'number') ? length : 12,