mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-03 21:48:27 +00:00
fixed browser specific issues
This commit is contained in:
@@ -221,7 +221,7 @@ wn.versions.check();$(document).bind('ready',function(){var base=window.location
|
||||
/*
|
||||
* lib/js/core.js
|
||||
*/
|
||||
wn.versions.check();$(document).bind('ready',function(){var base=window.location.href.split('#')[0];$.each($('a[softlink!="false"]'),function(i,v){if(v.href.substr(0,base.length)==base){var path=(v.href.substr(base.length));if(path.substr(0,1)!='#'){v.href=base+'#'+path;}}});if(!wn.settings.no_history&&window.location.hash){wn.page.set(window.location.hash.substr(1));}});
|
||||
wn.versions.check();$(document).bind('ready',function(){var base=window.location.href.split('#')[0];$.each($('a[softlink!="false"]'),function(i,v){if(v.href.substr(0,base.length)==base){var path=(v.href.substr(base.length));if(path.substr(0,1)!='#'){v.href=base+'#'+path;}}});if(!wn.settings.no_history&&window.location.hash){wn.page.set(window.location.hash.substr(1));}});
|
||||
/*
|
||||
* lib/js/legacy/globals.js
|
||||
*/
|
||||
@@ -349,7 +349,6 @@ span.done_working=function(){this.disabled=0;$dh(this.loading_img);}
|
||||
wn.tinymce={add_simple:function(ele,height){if(ele.myid){tinyMCE.execCommand('mceAddControl',true,ele.myid);return;}
|
||||
ele.myid=wn.dom.set_unique_id(ele);$(ele).tinymce({script_url:'lib/js/legacy/tiny_mce_33/tiny_mce.js',height:height?height:'200px',theme:"advanced",theme_advanced_buttons1:"bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,outdent,indent,link,unlink,forecolor,backcolor,code,",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_path:false,theme_advanced_resizing:false});},remove:function(ele){tinyMCE.execCommand('mceRemoveControl',true,ele.myid);},get_value:function(ele){return tinymce.get(ele.myid).getContent();}}
|
||||
wn.ele={link:function(args){var span=$a(args.parent,'span','link_type',args.style);span.loading_img=$a(args.parent,'img','',{margin:'0px 4px -2px 4px',display:'none'});span.loading_img.src='lib/images/ui/button-load.gif';span.innerHTML=args.label;span.user_onclick=args.onclick;span.onclick=function(){if(!this.disabled)this.user_onclick(this);}
|
||||
span.set_working=function(){this.disabled=1;$di(this.loading_img);}
|
||||
span.set_working=function(){this.disabled=1;$di(this.loading_img);}
|
||||
span.done_working=function(){this.disabled=0;$dh(this.loading_img);}
|
||||
return span;}}
|
||||
@@ -376,13 +375,9 @@ c.src=className
|
||||
function h2d(h){return parseInt(h,16);}
|
||||
var $n='\n';function set_title(t){document.title=(wn.title_prefix?(wn.title_prefix+' - '):'')+t;}
|
||||
function $a(parent,newtag,className,cs,innerHTML,onclick){if(parent&&parent.substr)parent=$i(parent);var c=document.createElement(newtag);if(parent)
|
||||
parent.appendChild(c);if(className){if(newtag.toLowerCase()=='img')
|
||||
c.src=className
|
||||
else
|
||||
c.className=className;}
|
||||
if(cs)$y(c,cs);if(innerHTML)c.innerHTML=innerHTML;if(onclick)c.onclick=onclick;return c;}
|
||||
function $a_input(p,in_type,attributes,cs){if(!attributes)attributes={};if(in_type)attributes.type=in_type
|
||||
if(isIE){var s='<input ';for(key in attributes)
|
||||
parent.appendChild(c);if(className){if(newtag.toLowerCase()=='img')
|
||||
c.src=className
|
||||
else
|
||||
c.className=className;}
|
||||
if(cs)$y(c,cs);if(innerHTML)c.innerHTML=innerHTML;if(onclick)c.onclick=onclick;return c;}
|
||||
function $a_input(p,in_type,attributes,cs){if(!attributes)attributes={};var $input=$(p).append('<input type="'+in_type+'">').find('input:last');for(key in attributes)
|
||||
@@ -573,14 +568,14 @@ cur_frm.runclientscript(this.df.fieldname,this.doctype,this.docname);cur_frm.ref
|
||||
var disp_val=val;if(val==null)disp_val='';this.set_disp(disp_val);}
|
||||
Field.prototype.run_trigger=function(){this.refresh_label_icon();if(this.df.reqd&&this.get_value&&!is_null(this.get_value())&&this.set_as_error)
|
||||
this.set_as_error(0);if(this.not_in_form){return;}
|
||||
if(cur_frm.cscript[this.df.fieldname])
|
||||
if(cur_frm.cscript[this.df.fieldname])
|
||||
cur_frm.runclientscript(this.df.fieldname,this.doctype,this.docname);cur_frm.refresh_dependency();}
|
||||
Field.prototype.set_disp_html=function(t){if(this.disp_area){$(this.disp_area).addClass('disp_area');this.disp_area.innerHTML=(t==null?'':t);if(!t)$(this.disp_area).addClass('disp_area_no_val');}}
|
||||
Field.prototype.set_disp=function(val){this.set_disp_html(val);}
|
||||
Field.prototype.set_as_error=function(set){if(this.in_grid||this.in_filter)return;var w=this.txt?this.txt:this.input;if(set){$y(w,{border:'2px solid RED'});}else{$y(w,{border:'1px solid #888'});}}
|
||||
Field.prototype.activate=function(docname){this.docname=docname;this.refresh();if(this.input){var v=_f.get_value(this.doctype,this.docname,this.df.fieldname);this.last_value=v;if(this.input.onchange&&this.input.get_value&&this.input.get_value()!=v){if(this.validate)
|
||||
this.input.set_value(this.validate(v));else
|
||||
this.input.set_value((v==null)?'':v);if(this.format_input)
|
||||
this.input.set_value(this.validate(v));else
|
||||
this.input.set_value((v==null)?'':v);if(this.format_input)
|
||||
this.format_input();}
|
||||
if(this.input.focus){try{this.input.focus();}catch(e){}}}
|
||||
if(this.txt){try{this.txt.focus();}catch(e){}
|
||||
@@ -644,8 +639,7 @@ return 0;return flt(v,2);}
|
||||
function FloatField(){}FloatField.prototype=new DataField();FloatField.prototype.validate=function(v){var v=parseFloat(v);if(isNaN(v))return null;return v;};FloatField.prototype.format_input=function(){if(this.input.value==null)this.input.value='';}
|
||||
function CurrencyField(){}CurrencyField.prototype=new DataField();CurrencyField.prototype.format_input=function(){var v=fmt_money(this.input.value);if(this.not_in_form){if(!flt(this.input.value))v='';}
|
||||
this.input.value=v;}
|
||||
CurrencyField.prototype.validate=function(v){if(v==null||v=='')
|
||||
return 0;return flt(v,2);}
|
||||
CurrencyField.prototype.validate=function(v){if(v==null||v=='')
|
||||
return 0;return flt(v,2);}
|
||||
CurrencyField.prototype.set_disp=function(val){var v=fmt_money(val);this.set_disp_html(v);}
|
||||
CurrencyField.prototype.onmake_input=function(){if(!this.input)return;this.input.onfocus=function(){if(flt(this.value)==0)this.select();}}
|
||||
@@ -666,8 +660,7 @@ text_dialog=d;}
|
||||
if(this.field.df.description)
|
||||
$a(this.widgets['Description'],'div','field_description','',this.field.df.description);}
|
||||
d.onhide=function(){if(_f.cur_grid_cell)
|
||||
_f.cur_grid_cell.grid.cell_deselect();}
|
||||
text_dialog=d;}
|
||||
_f.cur_grid_cell.grid.cell_deselect();}
|
||||
text_dialog=d;}
|
||||
TextField.prototype.table_refresh=function(){if(!this.text_dialog)
|
||||
make_text_dialog();text_dialog.set_title('Enter text for "'+this.df.label+'"');text_dialog.field=this;text_dialog.show();}
|
||||
@@ -692,8 +685,7 @@ function TimeField(){}TimeField.prototype=new Field();TimeField.prototype.get_ti
|
||||
val=me.input.options[0].value;return val;}
|
||||
return me.input.value;}}
|
||||
this.set_attach_options=function(){if(!cur_frm)return;var fl=cur_frm.doc.file_list;if(fl){this.df.options='';var fl=fl.split('\n');for(var i in fl){this.df.options+='\n'+fl[i].split(',')[1];}}else{this.df.options=''}}
|
||||
this.refresh();}
|
||||
function TimeField(){}TimeField.prototype=new Field();TimeField.prototype.get_time=function(){return time_to_hhmm(sel_val(this.input_hr),sel_val(this.input_mn),sel_val(this.input_am));}
|
||||
this.refresh();}
|
||||
function TimeField(){}TimeField.prototype=new Field();TimeField.prototype.get_time=function(){return time_to_hhmm(sel_val(this.input_hr),sel_val(this.input_mn),sel_val(this.input_am));}
|
||||
TimeField.prototype.set_time=function(v){ret=time_to_ampm(v);this.input_hr.inp.value=ret[0];this.input_mn.inp.value=ret[1];this.input_am.inp.value=ret[2];}
|
||||
TimeField.prototype.set_style_mandatory=function(){}
|
||||
@@ -748,8 +740,7 @@ $ds(this.wrapper);freeze();this.display=true;cur_dialog=this;if(this.onshow)this
|
||||
this.cancel_img=img;}
|
||||
this.set_title=function(t){this.title_text.innerHTML=t?t:'';}
|
||||
this.set_postion=function(){var d=get_screen_dims();this.wrapper.style.left=((d.w-cint(this.wrapper.style.width))/2)+'px';this.wrapper.style.top=(get_scroll_top()+60)+'px';top_index++;$y(this.wrapper,{zIndex:top_index});}
|
||||
this.show=function(){if(this.display)return;this.set_postion()
|
||||
$ds(this.wrapper);freeze();this.display=true;cur_dialog=this;if(this.onshow)this.onshow();}
|
||||
this.show=function(){if(this.display)return;this.set_postion()
|
||||
$ds(this.wrapper);freeze();this.display=true;cur_dialog=this;if(this.onshow)this.onshow();}
|
||||
this.hide=function(){if(this.onhide)this.onhide();unfreeze();$dh(this.wrapper);if(cur_autosug)cur_autosug.clearSuggestions();this.display=false;cur_dialog=null;}
|
||||
this.no_cancel=function(){$dh(this.cancel_img);}
|
||||
@@ -1055,7 +1046,7 @@ if(!d.sel_type)d.sel_type='Value';d.set_title('Select a "'+d.sel_type+'" for fie
|
||||
*/
|
||||
search_fields={};function setlinkvalue(name){selector.input.set_input(name);selector.hide();}
|
||||
function makeselector(){var d=new Dialog(540,440,'Search');d.make_body([['Data','Beginning With','Tip: You can use wildcard "%"'],['Select','Search By'],['Button','Search'],['HTML','Help'],['HTML','Result']]);var inp=d.widgets['Beginning With'];var field_sel=d.widgets['Search By'];var btn=d.widgets['Search'];d.sel_type='';d.values_len=0;d.set=function(input,type,label){d.sel_type=type;d.input=input;if(d.style!='Link'){d.rows['Result'].innerHTML='';d.values_len=0;}
|
||||
d.style='Link';d.set_query_description()
|
||||
d.style='Link';d.set_query_description()
|
||||
if(!d.sel_type)d.sel_type='Value';d.set_title('Select a "'+d.sel_type+'" for field "'+label+'"');}
|
||||
d.set_search=function(dt){if(d.style!='Search'){d.rows['Result'].innerHTML='';d.values_len=0;}
|
||||
d.style='Search';if(d.input){d.input=null;sel_type=null;}
|
||||
@@ -1508,14 +1499,14 @@ cur_frm.runclientscript(this.df.fieldname,this.doctype,this.docname);cur_frm.ref
|
||||
var disp_val=val;if(val==null)disp_val='';this.set_disp(disp_val);}
|
||||
Field.prototype.run_trigger=function(){this.refresh_label_icon();if(this.df.reqd&&this.get_value&&!is_null(this.get_value())&&this.set_as_error)
|
||||
this.set_as_error(0);if(this.not_in_form){return;}
|
||||
if(cur_frm.cscript[this.df.fieldname])
|
||||
if(cur_frm.cscript[this.df.fieldname])
|
||||
cur_frm.runclientscript(this.df.fieldname,this.doctype,this.docname);cur_frm.refresh_dependency();}
|
||||
Field.prototype.set_disp_html=function(t){if(this.disp_area){$(this.disp_area).addClass('disp_area');this.disp_area.innerHTML=(t==null?'':t);if(!t)$(this.disp_area).addClass('disp_area_no_val');}}
|
||||
Field.prototype.set_disp=function(val){this.set_disp_html(val);}
|
||||
Field.prototype.set_as_error=function(set){if(this.in_grid||this.in_filter)return;var w=this.txt?this.txt:this.input;if(set){$y(w,{border:'2px solid RED'});}else{$y(w,{border:'1px solid #888'});}}
|
||||
Field.prototype.activate=function(docname){this.docname=docname;this.refresh();if(this.input){var v=_f.get_value(this.doctype,this.docname,this.df.fieldname);this.last_value=v;if(this.input.onchange&&this.input.get_value&&this.input.get_value()!=v){if(this.validate)
|
||||
this.input.set_value(this.validate(v));else
|
||||
this.input.set_value((v==null)?'':v);if(this.format_input)
|
||||
this.input.set_value(this.validate(v));else
|
||||
this.input.set_value((v==null)?'':v);if(this.format_input)
|
||||
this.format_input();}
|
||||
if(this.input.focus){try{this.input.focus();}catch(e){}}}
|
||||
if(this.txt){try{this.txt.focus();}catch(e){}
|
||||
@@ -1579,8 +1570,7 @@ return 0;return flt(v,2);}
|
||||
function FloatField(){}FloatField.prototype=new DataField();FloatField.prototype.validate=function(v){var v=parseFloat(v);if(isNaN(v))return null;return v;};FloatField.prototype.format_input=function(){if(this.input.value==null)this.input.value='';}
|
||||
function CurrencyField(){}CurrencyField.prototype=new DataField();CurrencyField.prototype.format_input=function(){var v=fmt_money(this.input.value);if(this.not_in_form){if(!flt(this.input.value))v='';}
|
||||
this.input.value=v;}
|
||||
CurrencyField.prototype.validate=function(v){if(v==null||v=='')
|
||||
return 0;return flt(v,2);}
|
||||
CurrencyField.prototype.validate=function(v){if(v==null||v=='')
|
||||
return 0;return flt(v,2);}
|
||||
CurrencyField.prototype.set_disp=function(val){var v=fmt_money(val);this.set_disp_html(v);}
|
||||
CurrencyField.prototype.onmake_input=function(){if(!this.input)return;this.input.onfocus=function(){if(flt(this.value)==0)this.select();}}
|
||||
@@ -1601,8 +1591,7 @@ text_dialog=d;}
|
||||
if(this.field.df.description)
|
||||
$a(this.widgets['Description'],'div','field_description','',this.field.df.description);}
|
||||
d.onhide=function(){if(_f.cur_grid_cell)
|
||||
_f.cur_grid_cell.grid.cell_deselect();}
|
||||
text_dialog=d;}
|
||||
_f.cur_grid_cell.grid.cell_deselect();}
|
||||
text_dialog=d;}
|
||||
TextField.prototype.table_refresh=function(){if(!this.text_dialog)
|
||||
make_text_dialog();text_dialog.set_title('Enter text for "'+this.df.label+'"');text_dialog.field=this;text_dialog.show();}
|
||||
@@ -1627,8 +1616,7 @@ function TimeField(){}TimeField.prototype=new Field();TimeField.prototype.get_ti
|
||||
val=me.input.options[0].value;return val;}
|
||||
return me.input.value;}}
|
||||
this.set_attach_options=function(){if(!cur_frm)return;var fl=cur_frm.doc.file_list;if(fl){this.df.options='';var fl=fl.split('\n');for(var i in fl){this.df.options+='\n'+fl[i].split(',')[1];}}else{this.df.options=''}}
|
||||
this.refresh();}
|
||||
function TimeField(){}TimeField.prototype=new Field();TimeField.prototype.get_time=function(){return time_to_hhmm(sel_val(this.input_hr),sel_val(this.input_mn),sel_val(this.input_am));}
|
||||
this.refresh();}
|
||||
function TimeField(){}TimeField.prototype=new Field();TimeField.prototype.get_time=function(){return time_to_hhmm(sel_val(this.input_hr),sel_val(this.input_mn),sel_val(this.input_am));}
|
||||
TimeField.prototype.set_time=function(v){ret=time_to_ampm(v);this.input_hr.inp.value=ret[0];this.input_mn.inp.value=ret[1];this.input_am.inp.value=ret[2];}
|
||||
TimeField.prototype.set_style_mandatory=function(){}
|
||||
@@ -1924,9 +1912,10 @@ if(this.df.fieldtype=='Text Editor'){this.disp_area.innerHTML=val;}else{this.dis
|
||||
if(this.df.fieldtype=='Text Editor'){$(me.input).tinymce({script_url:'lib/js/legacy/tiny_mce_33/tiny_mce.js',theme:"advanced",plugins:"style,inlinepopups,table",extended_valid_elements:"div[id|dir|class|align|style]",width:'100%',height:'360px',theme_advanced_buttons1:"bold,italic,underline,strikethrough,hr,|,justifyleft,justifycenter,justifyright,|,formatselect,fontselect,fontsizeselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,code,|,forecolor,backcolor,|,tablecontrols",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",content_css:"js/tiny_mce_33/custom_content.css",oninit:function(){me.init_editor();}});}else{$y(me.input,{fontFamily:'Courier, Fixed'});}}
|
||||
_f.CodeField.prototype.init_editor=function(){var me=this;this.editor=tinymce.get(this.myid);this.editor.onKeyUp.add(function(ed,e){me.set(ed.getContent());});this.editor.onPaste.add(function(ed,e){me.set(ed.getContent());});this.editor.onSetContent.add(function(ed,e){me.set(ed.getContent());});var c=locals[cur_frm.doctype][cur_frm.docname][this.df.fieldname];if(cur_frm&&c){this.editor.setContent(c);}}
|
||||
_f.CodeField.prototype.set_disp=function(val){$y(this.disp_area,{width:'90%'})
|
||||
if(this.df.fieldtype=='Text Editor'){this.disp_area.innerHTML=val;}else{this.disp_area.innerHTML='<textarea class="code_text" readonly=1>'+val+'</textarea>';}}
|
||||
/*
|
||||
* lib/js/legacy/widgets/form/grid.js
|
||||
if(this.df.fieldtype=='Text Editor'){this.disp_area.innerHTML=val;}else{this.disp_area.innerHTML='<textarea class="code_text" readonly=1>'+val+'</textarea>';}}
|
||||
/*
|
||||
* lib/js/legacy/widgets/form/grid.js
|
||||
*/
|
||||
_f.cur_grid_cell=null;_f.Grid=function(parent){}
|
||||
_f.Grid.prototype.init=function(parent,row_height){var me=this;this.col_idx_by_name={}
|
||||
this.alt_row_bg='#F2F2FF';this.row_height=row_height;if(!row_height)this.row_height='26px';this.make_ui(parent);this.insert_column('','','Int','Sr','50px','',[1,0,0]);if(this.oninit)this.oninit();$(this.wrapper).bind('keydown',function(e){me.notify_keypress(e,e.which);})
|
||||
@@ -1939,21 +1928,20 @@ _f.Grid.prototype.set_column_disp=function(fieldname,show){var cidx=this.col_idx
|
||||
var col=this.head_row.insertCell(idx);col.doctype=doctype;col.fieldname=fieldname;col.fieldtype=fieldtype;col.innerHTML='<div>'+label+'</div>';col.label=label;if(reqd)
|
||||
col.childNodes[0].style.color="#D22";col.style.width=width;col.options=options;col.perm=perm;this.col_idx_by_name[fieldname]=idx;}
|
||||
_f.Grid.prototype.reset_table_width=function(){var w=0;for(var i=0,len=this.head_row.cells.length;i<len;i++){w+=cint(this.head_row.cells[i].style.width);}
|
||||
this.head_tab.style.width=w+'px';this.tab.style.width=w+'px';}
|
||||
this.head_tab.style.width=w+'px';this.tab.style.width=w+'px';}
|
||||
_f.Grid.prototype.set_column_disp=function(fieldname,show){var cidx=this.col_idx_by_name[fieldname];if(!cidx){msgprint('Trying to hide unknown column: '+fieldname);return;}
|
||||
var disp=show?'table-cell':'none';this.head_row.cells[cidx].style.display=disp;for(var i=0,len=this.tab.rows.length;i<len;i++){var cell=this.tab.rows[i].cells[cidx];cell.style.display=disp;}
|
||||
this.reset_table_width();}
|
||||
_f.Grid.prototype.append_row=function(idx,docname){if(!idx)idx=this.tab.rows.length;var row=this.tab.insertRow(idx);row.docname=docname;if(idx%2)var odd=true;else var odd=false;var me=this;for(var i=0;i<this.head_row.cells.length;i++){var cell=row.insertCell(i);var hc=this.head_row.cells[i];cell.style.width=hc.style.width;cell.style.display=hc.style.display;cell.row=row;cell.grid=this;cell.className='grid_cell';cell.div=$a(cell,'div','grid_cell_div');if(this.row_height){cell.div.style.height=this.row_height;}
|
||||
cell.div.cell=cell;cell.div.onclick=function(e){me.cell_select(this.cell);}
|
||||
if(odd){$bg(cell,this.alt_row_bg);cell.is_odd=1;cell.div.style.border='2px solid '+this.alt_row_bg;}else $bg(cell,'#FFF');if(!hc.fieldname)cell.div.style.cursor='default';}
|
||||
this.set_ht();return row;}
|
||||
_f.Grid.prototype.refresh_cell=function(docname,fieldname){for(var r=0;r<this.tab.rows.length;r++){if(this.tab.rows[r].docname==docname){for(var c=0;c<this.head_row.cells.length;c++){var hc=this.head_row.cells[c];if(hc.fieldname==fieldname){this.set_cell_value(this.tab.rows[r].cells[c]);}}}}}
|
||||
_f.cur_grid;_f.cur_grid_ridx;_f.Grid.prototype.set_cell_value=function(cell){if(cell.row.is_newrow)return;var hc=this.head_row.cells[cell.cellIndex];if(hc.fieldname){var v=locals[hc.doctype][cell.row.docname][hc.fieldname];}else{var v=(cell.row.rowIndex+1);}
|
||||
if(v==null){v='';}
|
||||
this.set_ht();return row;}
|
||||
_f.Grid.prototype.refresh_cell=function(docname,fieldname){for(var r=0;r<this.tab.rows.length;r++){if(this.tab.rows[r].docname==docname){for(var c=0;c<this.head_row.cells.length;c++){var hc=this.head_row.cells[c];if(hc.fieldname==fieldname){this.set_cell_value(this.tab.rows[r].cells[c]);}}}}}
|
||||
_f.cur_grid;_f.cur_grid_ridx;_f.Grid.prototype.set_cell_value=function(cell){if(cell.row.is_newrow)return;var hc=this.head_row.cells[cell.cellIndex];if(hc.fieldname){var v=locals[hc.doctype][cell.row.docname][hc.fieldname];}else{var v=(cell.row.rowIndex+1);}
|
||||
if(v==null){v='';}
|
||||
var me=this;if(cell.cellIndex){var ft=hc.fieldtype;if(ft=='Link'&&cur_frm.doc.docstatus<1)ft='Data';$s(cell.div,v,ft,hc.options);}else{cell.div.style.padding='2px';cell.div.style.textAlign='left';cell.innerHTML='';var t=make_table(cell,1,3,'60px',['20px','20px','20px'],{verticalAlign:'middle',padding:'2px'});$y($td(t,0,0),{paddingLeft:'4px'});$td(t,0,0).innerHTML=cell.row.rowIndex+1;if(cur_frm.editable&&this.can_edit){var ed=$a($td(t,0,1),'div','wn-icon ic-doc_edit',{cursor:'pointer'});ed.cell=cell;ed.title='Edit Row';ed.onclick=function(){_f.cur_grid=me;_f.cur_grid_ridx=this.cell.row.rowIndex;_f.edit_record(me.doctype,this.cell.row.docname,1);}}else{cell.div.innerHTML=(cell.row.rowIndex+1);cell.div.style.cursor='default';cell.div.onclick=function(){}}}}
|
||||
return;this.cell_select(cell);if(cur_frm.editable){if(isIE){window.event.cancelBubble=true;window.event.returnValue=false;}else{e.preventDefault();}}}
|
||||
_f.Grid.prototype.notify_click=function(e,target){if(_f.cur_grid_cell&&!target.isactive){if(!(text_dialog&&text_dialog.display)&&!datepicker_active&&!(selector&&selector.display)&&!(cur_autosug)){_f.cur_grid_cell.grid.cell_deselect();}}}
|
||||
$(document).bind('click',function(e){var is_target_toolbar=function(){return $(e.target).parents('.grid_tbarlinks').length;}
|
||||
var is_target_input=function(){return $(e.target).parents().get().indexOf(_f.cur_grid_cell)!=-1;}
|
||||
if(_f.cur_grid_cell&&!is_target_input()&&!is_target_toolbar()){if(!(text_dialog&&text_dialog.display)&&!datepicker_active&&!(selector&&selector.display)&&!(cur_autosug)){_f.cur_grid_cell.grid.cell_deselect();}}});_f.Grid.prototype.cell_deselect=function(){if(_f.cur_grid_cell){var c=_f.cur_grid_cell;c.grid.remove_template(c);c.div.className='grid_cell_div';if(c.is_odd)c.div.style.border='2px solid '+c.grid.alt_row_bg;else c.div.style.border='2px solid #FFF';_f.cur_grid_cell=null;_f.cur_grid=null;}}
|
||||
_f.Grid.prototype.cell_select=function(cell,ri,ci){if(ri!=null&&ci!=null)
|
||||
cell=this.tab.rows[ri].cells[ci];var hc=this.head_row.cells[cell.cellIndex];if(!hc.template){this.make_template(hc);}
|
||||
@@ -1964,7 +1952,7 @@ _f.Grid.prototype.remove_template=function(cell){var hc=this.head_row.cells[cell
|
||||
return{}}
|
||||
_f.grid_date_cell='';_f.grid_refresh_date=function(){_f.grid_date_cell.grid.set_cell_value(_f.grid_date_cell);}
|
||||
_f.grid_refresh_field=function(temp,input){if(input.value!=_f.get_value(temp.doctype,temp.docname,temp.df.fieldname))
|
||||
if(input.onchange)input.onchange();}
|
||||
if(input.onchange)input.onchange();}
|
||||
_f.Grid.prototype.remove_template=function(cell){var hc=this.head_row.cells[cell.cellIndex];if(!hc.template)return;if(!hc.template.activated)return;if(hc.template.txt){if(hc.template.df.fieldtype=='Date'){_f.grid_date_cell=cell;setTimeout('_f.grid_refresh_date()',100);}
|
||||
if(hc.template.txt.value)
|
||||
_f.grid_refresh_field(hc.template,hc.template.txt);}else if(hc.template.input){_f.grid_refresh_field(hc.template,hc.template.input);}
|
||||
@@ -2231,10 +2219,7 @@ var popup_cont;var session={};var start_sid=null;if(!wn)var wn={};function start
|
||||
me.dialog.clear();me.dialog.show();}});
|
||||
/*
|
||||
* lib/js/legacy/app.js
|
||||
*/
|
||||
var popup_cont;var session={};var start_sid=null;if(!wn)var wn={};function startup(){start_sid=get_cookie('sid');popup_cont=$a(document.getElementsByTagName('body')[0],'div');var setup_globals=function(r){wn.boot=r;profile=r.profile;user=r.profile.name;user_fullname=profile.first_name+(r.profile.last_name?(' '+r.profile.last_name):'');user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;profile.start_items=r.start_items;home_page=r.home_page;_p.letter_heads=r.letter_heads;sys_defaults=r.sysdefaults;session.rt=profile.can_read;if(r.ipinfo)session.ipinfo=r.ipinfo;session.dt_labels=r.dt_labels;session.rev_dt_labels={}
|
||||
if(r.dt_labels){for(key in r.dt_labels)session.rev_dt_labels[r.dt_labels[key]]=key;}
|
||||
wn.control_panel=r.control_panel;}
|
||||
*/
|
||||
var popup_cont;var session={};var start_sid=null;if(!wn)var wn={};function startup(){start_sid=get_cookie('sid');popup_cont=$a(document.getElementsByTagName('body')[0],'div');var setup_globals=function(r){wn.boot=r;profile=r.profile;user=r.profile.name;user_fullname=profile.first_name+(r.profile.last_name?(' '+r.profile.last_name):'');user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;profile.start_items=r.start_items;home_page=r.home_page;_p.letter_heads=r.letter_heads;sys_defaults=r.sysdefaults;session.rt=profile.can_read;if(r.ipinfo)session.ipinfo=r.ipinfo;session.dt_labels=r.dt_labels;session.rev_dt_labels={}
|
||||
if(r.dt_labels){for(key in r.dt_labels)session.rev_dt_labels[r.dt_labels[key]]=key;}
|
||||
wn.control_panel=r.control_panel;}
|
||||
|
||||
Reference in New Issue
Block a user