Ver Fonte

Add HTMLCanvas>>style: shortcut

Laurent Laffont há 12 anos atrás
pai
commit
b0d8f84ff3
3 ficheiros alterados com 31 adições e 0 exclusões
  1. 11 0
      js/Canvas.deploy.js
  2. 16 0
      js/Canvas.js
  3. 4 0
      st/Canvas.st

+ 11 - 0
js/Canvas.deploy.js

@@ -572,6 +572,17 @@ return self;}
 }),
 smalltalk.HTMLCanvas);
 
+smalltalk.addMethod(
+'_style_',
+smalltalk.method({
+selector: 'style:',
+fn: function (aString){
+var self=this;
+return (function($rec){smalltalk.send($rec, "_with_", [aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_style", []));
+return self;}
+}),
+smalltalk.HTMLCanvas);
+
 
 smalltalk.addMethod(
 '_onJQuery_',

+ 16 - 0
js/Canvas.js

@@ -832,6 +832,22 @@ referencedClasses: []
 }),
 smalltalk.HTMLCanvas);
 
+smalltalk.addMethod(
+unescape('_style_'),
+smalltalk.method({
+selector: unescape('style%3A'),
+category: 'tags',
+fn: function (aString){
+var self=this;
+return (function($rec){smalltalk.send($rec, "_with_", [aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_style", []));
+return self;},
+args: ["aString"],
+source: unescape('style%3A%20aString%0A%09%5E%20self%20style%20with%3A%20aString%3B%20yourself%20'),
+messageSends: ["with:", "yourself", "style"],
+referencedClasses: []
+}),
+smalltalk.HTMLCanvas);
+
 
 smalltalk.addMethod(
 unescape('_onJQuery_'),

+ 4 - 0
st/Canvas.st

@@ -217,6 +217,10 @@ ul: anObject
 
 span: anObject
     ^self span with: anObject
+!
+
+style: aString
+	^ self style with: aString; yourself
 ! !
 
 !HTMLCanvas class methodsFor: 'instance creation'!