Procházet zdrojové kódy

HUE 30: Add support for Behavior Filters to add keyboard events to JFrame instance

Aaron Newton před 15 roky
rodič
revize
6c91cab456

+ 2 - 2
apps/beeswax/src/beeswax/templates/beeswax_components.mako

@@ -52,10 +52,10 @@
     attrs = {}
   if not render_default:
     attrs.setdefault('type', 'text')
-
+    
   if data_filters:
     attrs.data_filters = data_filters
-
+  
   classes = []
   if klass:
     classes.append(klass)

+ 8 - 4
desktop/core/static/js/Source/CCS/CCS.JFrame.js

@@ -106,6 +106,9 @@ CCS.JFrame = new Class({
 		this.addFilters(this.options.filters);
 
 		this.behavior = new Behavior(this.element);
+		['attachKeys', 'detachKeys', 'addShortcut', 'addShortcuts', 'removeShortcut', 'removeShortcuts', 'applyDelegates'].each(function(method){
+			this.behavior.passMethod(method, this[method].bind(this));
+		}, this);
 		this.addEvent('resize', this.behavior.resize.bind(this.behavior));
 		this.addBehaviors(this.options.behaviors);
 
@@ -310,12 +313,13 @@ CCS.JFrame = new Class({
 		fill: fills a given target with the appropriate content
 		target - (*element*) the target to fill with content
 		content - (*object*) an object with the following properties:
-			js - (*string*) any inline javascript to evalutate (stripped from <script> tags)
+			js - (*string*) any the inline javascript to evalutate,
 			links - (*elements array*) css links to be injected into the target
 			elements - (*elements array*) elements to inject into the target (i.e. the actual content)
 			title - (*string*) the title of the content
 			view - (*string*; optional) if defined, the view of the content
 			viewElement - (*element*; optional) if defined, the element for the view
+		
 	*/
 
 	fill: function(target, content){
@@ -337,7 +341,7 @@ CCS.JFrame = new Class({
 		};
 		this.fireEvent('resize', [x, y]);
 	},
-
+	
 	filters: {},
 
 	/*
@@ -371,7 +375,7 @@ CCS.JFrame = new Class({
 	addBehavior: function(name, fn, overwrite){
 		this.behavior.addFilter(name, fn, overwrite);
 	},
-
+	
 	/*
 		add a group of behavior filters
 		obj - (*object*) an object of key/value pairs of name/functions for filters (see addBehavior)
@@ -391,7 +395,7 @@ CCS.JFrame = new Class({
 		var behavior = this.behavior.lookup(name);
 		this.behavior.applyBehavior(element, behavior, force);
 	},
-
+	
 	//Applies all the behavior filters for an element.
 	//element - (element) an element to apply the filters registered with this Behavior instance to.
 	//force - (boolean; optional) passed through to applyBehavior (see it for docs)

+ 2 - 2
desktop/core/static/js/Source/UI/ART.SideBySideSelect.js

@@ -105,7 +105,7 @@ ART.SideBySideSelect = new Class({
 		this.selected.body.empty();
 		this.deselected.body.empty();
 		this.select.getElements('option').each(function(option){
-			var name = [option.get('text') || option.get('value')];
+			var name = option.get('text') || option.get('value');
 			this._options[name] = option;
 			var row = this._makeRow(name, option.get('selected') ? 'selected' : 'deselected');
 		}, this);
@@ -268,7 +268,7 @@ ART.SideBySideSelect = new Class({
 
 	//given a name, create a row in the specified table; either 'selected' or 'deselected'
 	_makeRow: function(name, where){
-		var row = this[where].push([this.options.makeContent.call(this, name, true)]).tr.store('_sideBySide:name', name);
+		var row = this[where].push([this.options.makeContent.call(this, name, where)]).tr.store('_sideBySide:name', name);
 		this._options[name].set('selected', where == 'selected');
 		this._rows[name] = row;
 		return row;

+ 1 - 1
ext/thirdparty/js/art-widgets.hash

@@ -1 +1 @@
-25952ed9d715ed02fe3d546d9ccaeb492c87c1ab
+8ec4362bd182204cb859b858346473e5245c0a7a

+ 1 - 1
ext/thirdparty/js/mootools-more.hash

@@ -1 +1 @@
-d9bcdcade799d7254241bf0f3fb24ba5d85743e8
+26eee33478d302464c895ad3533950b09085ab73