|
@@ -103,7 +103,6 @@ CCS.JFrame = new Class({
|
|
|
//given the response and response text, this method determines if there's been a serverside error
|
|
//given the response and response text, this method determines if there's been a serverside error
|
|
|
errorDetector: function(requestInstance, responseText) {
|
|
errorDetector: function(requestInstance, responseText) {
|
|
|
//flag this as an error
|
|
//flag this as an error
|
|
|
- return repsonseText.contains('ccs-error-popup');
|
|
|
|
|
return responseText.contains('ccs-error-popup');
|
|
return responseText.contains('ccs-error-popup');
|
|
|
},
|
|
},
|
|
|
getScroller: function(){
|
|
getScroller: function(){
|
|
@@ -176,12 +175,25 @@ CCS.JFrame = new Class({
|
|
|
this.element = this.element || new Element('div').setStyles({display: 'block', position: 'relative', outline: 'none'}).store('widget', this);
|
|
this.element = this.element || new Element('div').setStyles({display: 'block', position: 'relative', outline: 'none'}).store('widget', this);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ delegatedTo: [],
|
|
|
|
|
+
|
|
|
|
|
+/*
|
|
|
|
|
+
|
|
|
|
|
+ the JFrame callClick event invokes the click handler for links/elements, matching against any JFrameLinkers and,
|
|
|
|
|
+ if none are found, running the default click handler (which is to load the link's href, if defined, into the JFrame).
|
|
|
|
|
+ event - (*object*) the event object that was fired; a click, usually
|
|
|
|
|
+ link - (*element*) typically an anchor tag, though that's not a requirement
|
|
|
|
|
+ force - (*boolean*) forces the link to be activated even if it has the css class .disabled or .jframe_ignore
|
|
|
|
|
+ callClick: function(event, link, force) {
|
|
|
|
|
+ //this function is defined in the applyDelegates function below;
|
|
|
|
|
+ //this commented out version added here for visibility's sake
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+*/
|
|
|
/*
|
|
/*
|
|
|
applies the default link handling delegates to a specific target, allowing you to attach link handling to any container
|
|
applies the default link handling delegates to a specific target, allowing you to attach link handling to any container
|
|
|
target - (*element*) the element to which you wish to attach delegates
|
|
target - (*element*) the element to which you wish to attach delegates
|
|
|
*/
|
|
*/
|
|
|
- delegatedTo: [],
|
|
|
|
|
-
|
|
|
|
|
applyDelegates: function(target){
|
|
applyDelegates: function(target){
|
|
|
target = document.id(target) || this.content;
|
|
target = document.id(target) || this.content;
|
|
|
//make sure we only apply this once per target
|
|
//make sure we only apply this once per target
|
|
@@ -209,11 +221,11 @@ CCS.JFrame = new Class({
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}.bind(this);
|
|
}.bind(this);
|
|
|
- this.callClick = function(e, elem){
|
|
|
|
|
|
|
+ this.callClick = function(e, elem, force){
|
|
|
//allow links to force jframe to nerf them
|
|
//allow links to force jframe to nerf them
|
|
|
//this is required for doubleclick support
|
|
//this is required for doubleclick support
|
|
|
//as otherwise there's no way to prevent this default jframe handler per link
|
|
//as otherwise there's no way to prevent this default jframe handler per link
|
|
|
- if (elem.hasClass('jframe_ignore') || elem.hasClass('disabled')) return e.preventDefault();
|
|
|
|
|
|
|
+ if (!force && (elem.hasClass('jframe_ignore') || elem.hasClass('disabled'))) return e.preventDefault();
|
|
|
// Fix relative links
|
|
// Fix relative links
|
|
|
if (elem.get('href')) {
|
|
if (elem.get('href')) {
|
|
|
var url = new URI(elem.get('href'), {base: this.currentPath});
|
|
var url = new URI(elem.get('href'), {base: this.currentPath});
|