Roo/form/Signature.js
authorAlan Knowles <alan@roojs.com>
Wed, 16 Oct 2013 07:25:49 +0000 (15:25 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 16 Oct 2013 07:25:49 +0000 (15:25 +0800)
Roo/form/Signature.js

index ea511e0..0d81b99 100644 (file)
@@ -105,7 +105,7 @@ Roo.extend(Roo.form.Signature, Roo.form.Field,  {
               cn : [
                 {
                     tag: "rect",
-                    id: "svg-r",
+                    cls: "roo-signature-svg-r",
                     width: this.width,
                     height: this.height,
                     fill: "#ffa"
@@ -124,7 +124,7 @@ Roo.extend(Roo.form.Signature, Roo.form.Field,  {
                 },
                 {
                     tag: "path",
-                    id: "svg-p",
+                    cls: "roo-signature-svg-p",
                     'stroke': "navy",
                     'stroke-width': "3",
                     'fill': "none",
@@ -137,7 +137,7 @@ Roo.extend(Roo.form.Signature, Roo.form.Field,  {
     },
     createSVG : function(){ 
         var svg = this.signPanel;
-        var r = svg.select('#svg-r', true).first().dom;
+        var r = svg.select('roo-signature-svg-r', true).first().dom;
         var t = this;
 
         r.addEventListener('mousedown', function(e) { return t.down(e); }, false);
@@ -168,7 +168,7 @@ Roo.extend(Roo.form.Signature, Roo.form.Field,  {
     //mouse event headler 
     down : function (e) {
         this.signatureTmp += 'M' + this.getCoords(e) + ' ';
-        this.signPanel.select('#svg-p', true).first().attr('d', this.signatureTmp);
+        this.signPanel.select('roo-signature-svg-p', true).first().attr('d', this.signatureTmp);
         
         this.isMouseDown = true;
         
@@ -177,7 +177,7 @@ Roo.extend(Roo.form.Signature, Roo.form.Field,  {
     move : function (e) {
         if (this.isMouseDown) {
             this.signatureTmp += 'L' + this.getCoords(e) + ' ';
-            this.signPanel.select('#svg-p', true).first().attr('d', this.signatureTmp);
+            this.signPanel.select('roo-signature-svg-p', true).first().attr('d', this.signatureTmp);
         }
         
         e.preventDefault();
@@ -195,7 +195,7 @@ Roo.extend(Roo.form.Signature, Roo.form.Field,  {
             }
         }
         if(this.getValue() != this.signatureTmp){
-            this.signPanel.select('#svg-r', true).first().attr('fill', '#ffa');
+            this.signPanel.select('roo-signature-svg-r', true).first().attr('fill', '#ffa');
             this.isConfirmed = false;
         }
         e.preventDefault();
@@ -272,8 +272,8 @@ Roo.extend(Roo.form.Signature, Roo.form.Field,  {
     // private
     reset : function(){
         this.signatureTmp = '';
-        this.signPanel.select('#svg-r', true).first().attr('fill', '#ffa');
-        this.signPanel.select('#svg-p', true).first().attr('d', '');
+        this.signPanel.select('roo-signature-svg-r', true).first().attr('fill', '#ffa');
+        this.signPanel.select('roo-signature-svg-p', true).first().attr('d', '');
         this.isConfirmed = false;
         Roo.form.Signature.superclass.reset.call(this);
     },