/**
 * Theme: Adminox Admin Template
 * Author: Coderthemes
 * X editable
 */


$(function(){$.fn.editableform.buttons='<button type="submit" class="btn btn-primary editable-submit btn-sm waves-effect waves-light"><i class="mdi mdi-check"></i></button><button type="button" class="btn btn-default editable-cancel btn-sm waves-effect"><i class="mdi mdi-close"></i></button>',$("#username").editable({type:"text",pk:1,name:"username",title:"Enter username"}),$("#firstname").editable({validate:function(e){return""==$.trim(e)?"This field is required":void 0}}),$("#sex").editable({prepend:"not selected",source:[{value:1,text:"Male"},{value:2,text:"Female"}],display:function(e,t){var i={"":"gray",1:"green",2:"blue"},n=$.grep(t,function(t){return t.value==e})
n.length?$(this).text(n[0].text).css("color",i[e]):$(this).empty()}}),$("#group").editable({showbuttons:!1,url:"/post"}),$("#status").editable(),$("#dob").editable(),$("#event").editable({placement:"right",combodate:{firstItem:"name"}}),$("#comments").editable({showbuttons:"bottom"}),$("#fruits").editable({pk:1,limit:3,source:[{value:1,text:"Banana"},{value:2,text:"Peach"},{value:3,text:"Apple"},{value:4,text:"Watermelon"},{value:5,text:"Orange"}]}),$("#tags").editable({inputclass:"input-large",select2:{tags:["html","javascript","css","ajax"],tokenSeparators:[","," "]}}),$("#inline-username").editable({type:"text",pk:1,name:"username",title:"Enter username",mode:"inline"}),$("#inline-firstname").editable({validate:function(e){return""==$.trim(e)?"This field is required":void 0},mode:"inline"}),$("#inline-sex").editable({prepend:"not selected",mode:"inline",source:[{value:1,text:"Male"},{value:2,text:"Female"}],display:function(e,t){var i={"":"gray",1:"green",2:"blue"},n=$.grep(t,function(t){return t.value==e})
n.length?$(this).text(n[0].text).css("color",i[e]):$(this).empty()}}),$("#inline-group").editable({showbuttons:!1,mode:"inline"}),$("#inline-status").editable({mode:"inline"}),$("#inline-dob").editable({mode:"inline"}),$("#inline-event").editable({placement:"right",mode:"inline",combodate:{firstItem:"name"}}),$("#inline-comments").editable({showbuttons:"bottom",mode:"inline"}),$("#inline-fruits").editable({pk:1,limit:3,mode:"inline",source:[{value:1,text:"Banana"},{value:2,text:"Peach"},{value:3,text:"Apple"},{value:4,text:"Watermelon"},{value:5,text:"Orange"}]}),$("#inline-tags").editable({inputclass:"input-large",mode:"inline",select2:{tags:["html","javascript","css","ajax"],tokenSeparators:[","," "]}})})
