mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-26 21:01:30 +02:00
Fix js errors if readonly
This commit is contained in:
parent
69ce664000
commit
8ada656d56
@ -79,7 +79,7 @@ var et2_link_to = (function(){ "use strict"; return et2_inputWidget.extend(
|
|||||||
init: function() {
|
init: function() {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
|
|
||||||
this.div = null;
|
this.div = jQuery(document.createElement("div")).addClass("et2_link_to et2_toolbar");
|
||||||
|
|
||||||
this.link_button = null;
|
this.link_button = null;
|
||||||
this.status_span = null;
|
this.status_span = null;
|
||||||
@ -87,7 +87,7 @@ var et2_link_to = (function(){ "use strict"; return et2_inputWidget.extend(
|
|||||||
this.link_entry = null;
|
this.link_entry = null;
|
||||||
this.file_upload = null;
|
this.file_upload = null;
|
||||||
|
|
||||||
if (!this.options.readonly) this.createInputWidget();
|
this.createInputWidget();
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
@ -127,7 +127,6 @@ var et2_link_to = (function(){ "use strict"; return et2_inputWidget.extend(
|
|||||||
},
|
},
|
||||||
|
|
||||||
createInputWidget: function() {
|
createInputWidget: function() {
|
||||||
this.div = jQuery(document.createElement("div")).addClass("et2_link_to et2_toolbar");
|
|
||||||
|
|
||||||
// Need a div for file upload widget
|
// Need a div for file upload widget
|
||||||
this.file_div = jQuery(document.createElement("div")).css({display:'inline-block'}).appendTo(this.div);
|
this.file_div = jQuery(document.createElement("div")).css({display:'inline-block'}).appendTo(this.div);
|
||||||
@ -141,16 +140,19 @@ var et2_link_to = (function(){ "use strict"; return et2_inputWidget.extend(
|
|||||||
// Leave room for link button
|
// Leave room for link button
|
||||||
.appendTo(this.div);
|
.appendTo(this.div);
|
||||||
|
|
||||||
// One common link button
|
if (!this.options.readonly)
|
||||||
this.link_button = jQuery(document.createElement("button"))
|
{
|
||||||
.text(this.egw().lang(this.options.link_label))
|
// One common link button
|
||||||
.appendTo(this.div).hide()
|
this.link_button = jQuery(document.createElement("button"))
|
||||||
.addClass('link')
|
.text(this.egw().lang(this.options.link_label))
|
||||||
.click(this, this.createLink);
|
.appendTo(this.div).hide()
|
||||||
|
.addClass('link')
|
||||||
|
.click(this, this.createLink);
|
||||||
|
|
||||||
// Span for indicating status
|
// Span for indicating status
|
||||||
this.status_span = jQuery(document.createElement("span"))
|
this.status_span = jQuery(document.createElement("span"))
|
||||||
.appendTo(this.div).addClass("status").hide();
|
.appendTo(this.div).addClass("status").hide();
|
||||||
|
}
|
||||||
|
|
||||||
this.setDOMNode(this.div[0]);
|
this.setDOMNode(this.div[0]);
|
||||||
},
|
},
|
||||||
@ -413,6 +415,7 @@ var et2_link_to = (function(){ "use strict"; return et2_inputWidget.extend(
|
|||||||
|
|
||||||
set_no_files: function(no_files)
|
set_no_files: function(no_files)
|
||||||
{
|
{
|
||||||
|
if(this.options.readonly) return;
|
||||||
if(no_files)
|
if(no_files)
|
||||||
{
|
{
|
||||||
this.file_div.hide();
|
this.file_div.hide();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user