Przeglądaj źródła

DocumentMenu now static toolbar

Michael 10 lat temu
rodzic
commit
247142fdf8

+ 1 - 9
src/allplatforms/classes/DocumentMenu.js

@@ -61,20 +61,12 @@ SC.loadPackage({ 'DocumentMenu': {
             comment: 'Show me at { x: anInt, y: anInt }',
             code: function(myCoordinates){
 
-                var self = this,
-                    myNode        = this.get('myNode'),
-                    topContainer  = this.get('topContainer'),
-                    leftContainer = this.get('leftContainer');
+                var myNode        = this.get('myNode');
 
                 if(myNode.parentNode === document.body){
                     return this.do('close');
                 }
 
-                topContainer.style.top   = (myCoordinates.y - 42 > 0 ? myCoordinates.y - 42 : 2 ) + 'px';
-                topContainer.style.left  = (myCoordinates.x - 42 > 0 ? myCoordinates.x      : 42) + 'px';
-                leftContainer.style.top  = (myCoordinates.y - 42 > 0 ? myCoordinates.y      : 42) + 'px';
-                leftContainer.style.left = (myCoordinates.x - 42 > 0 ? myCoordinates.x - 42 : 2 ) + 'px';
-
 
                 document.body.insertBefore(myNode, SuperGlue.get('windowManager').get('windowsContainer'));
 

+ 5 - 10
src/allplatforms/classes/SliderWidget.js

@@ -77,18 +77,13 @@ SC.loadPackage({ 'SliderWidget': {
                             yPosition = 0,
                             newY;
                         
+                        while(currentElement){
+                            yPosition += (currentElement.offsetTop - currentElement.scrollTop + currentElement.clientTop);
+                            currentElement = currentElement.offsetParent;
+                        }
+                        
                         if(navigator.userAgent.indexOf('Firefox') > 0){
-                            while(currentElement){
-                                console.log('yes')
-                                yPosition += (currentElement.offsetTop + currentElement.clientTop);
-                                currentElement = currentElement.offsetParent;
-                            }
                             yPosition -= document.documentElement.scrollTop;
-                        }else{
-                            while(currentElement){
-                                yPosition += (currentElement.offsetTop - currentElement.scrollTop + currentElement.clientTop);
-                                currentElement = currentElement.offsetParent;
-                            }
                         }
 
                         newY = evt.clientY - yPosition;

+ 6 - 3
src/allplatforms/css/DocumentMenu.css

@@ -1,17 +1,20 @@
 
 #sg-editing-document-menu {
 	pointer-events: none;
-	position:       relative;
 	top:            0px;
 }
 
 #sg-editing-document-menu-top  {
-	position: 		absolute;
+	position:       fixed;
+	top:			25px;
+	left:			55px;
 	width:			300px;
 	height:			30px;
 }
 
 #sg-editing-document-menu-left {
-	position: 		absolute;
+	position:       fixed;
+	top:			65px;
+	left:			15px;
 	width:			30px;
 }

+ 34 - 34
src/allplatforms/css/icons/indent.left.svg

@@ -15,10 +15,10 @@
    viewBox="0 0 30 30"
    enable-background="new 0 0 30 30"
    xml:space="preserve"
-   id="svg3235"
+   id="svg3256"
    inkscape:version="0.48.4 r9939"
-   sodipodi:docname="icon_indent decrease.svg"><metadata
-     id="metadata3254">
+   sodipodi:docname="icon_indent increase.svg"><metadata
+     id="metadata3275">
          
            <rdf:RDF><cc:Work
          rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
@@ -32,7 +32,7 @@
            rdf:resource="http://creativecommons.org/ns#CommercialUse" /><cc:permits
            rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><cc:requires
            rdf:resource="http://creativecommons.org/ns#ShareAlike" /></cc:License></rdf:RDF></metadata><defs
-     id="defs3252" /><sodipodi:namedview
+     id="defs3273" /><sodipodi:namedview
      pagecolor="#ffffff"
      bordercolor="#666666"
      borderopacity="1"
@@ -43,55 +43,55 @@
      inkscape:pageshadow="2"
      inkscape:window-width="640"
      inkscape:window-height="480"
-     id="namedview3250"
+     id="namedview3271"
      showgrid="false"
      inkscape:zoom="8.1166667"
-     inkscape:cx="5.786692"
-     inkscape:cy="11.921211"
-     inkscape:window-x="726"
-     inkscape:window-y="215"
+     inkscape:cx="-5.2360641"
+     inkscape:cy="9.3591473"
+     inkscape:window-x="714"
+     inkscape:window-y="196"
      inkscape:window-maximized="0"
-     inkscape:current-layer="svg3235" /><g
+     inkscape:current-layer="svg3256" /><g
      id="inspiration"
      display="none" /><g
      id="labels" /><g
-     id="icons"><polygon
-       fill="#FFFFFF"
-       points="9,17.502 5,14.502 9,11.5  "
-       id="polygon3240" /><line
+     id="icons"><line
        fill="none"
        stroke="#FFFFFF"
        stroke-width="2"
        stroke-miterlimit="10"
-       x1="26"
-       y1="22"
-       x2="4"
-       y2="22"
-       id="line3242" /><line
+       x1="4"
+       y1="7"
+       x2="26"
+       y2="7"
+       id="line3261" /><line
        fill="none"
        stroke="#FFFFFF"
        stroke-width="2"
        stroke-miterlimit="10"
-       x1="26"
-       y1="17"
-       x2="12"
-       y2="17"
-       id="line3244" /><line
+       x1="12"
+       y1="12"
+       x2="26"
+       y2="12"
+       id="line3263" /><line
        fill="none"
        stroke="#FFFFFF"
        stroke-width="2"
        stroke-miterlimit="10"
-       x1="26"
-       y1="12"
-       x2="12"
-       y2="12"
-       id="line3246" /><line
+       x1="12"
+       y1="17"
+       x2="26"
+       y2="17"
+       id="line3265" /><line
        fill="none"
        stroke="#FFFFFF"
        stroke-width="2"
        stroke-miterlimit="10"
-       x1="26"
-       y1="7"
-       x2="4"
-       y2="7"
-       id="line3248" /></g></svg>
+       x1="4"
+       y1="22"
+       x2="26"
+       y2="22"
+       id="line3267" /><polygon
+       fill="#FFFFFF"
+       points="4,11.5 8,14.5 4,17.502  "
+       id="polygon3269" /></g></svg>

+ 34 - 34
src/allplatforms/css/icons/indent.right.svg

@@ -15,10 +15,10 @@
    viewBox="0 0 30 30"
    enable-background="new 0 0 30 30"
    xml:space="preserve"
-   id="svg3256"
+   id="svg3235"
    inkscape:version="0.48.4 r9939"
-   sodipodi:docname="icon_indent increase.svg"><metadata
-     id="metadata3275">
+   sodipodi:docname="icon_indent decrease.svg"><metadata
+     id="metadata3254">
          
            <rdf:RDF><cc:Work
          rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
@@ -32,7 +32,7 @@
            rdf:resource="http://creativecommons.org/ns#CommercialUse" /><cc:permits
            rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><cc:requires
            rdf:resource="http://creativecommons.org/ns#ShareAlike" /></cc:License></rdf:RDF></metadata><defs
-     id="defs3273" /><sodipodi:namedview
+     id="defs3252" /><sodipodi:namedview
      pagecolor="#ffffff"
      bordercolor="#666666"
      borderopacity="1"
@@ -43,55 +43,55 @@
      inkscape:pageshadow="2"
      inkscape:window-width="640"
      inkscape:window-height="480"
-     id="namedview3271"
+     id="namedview3250"
      showgrid="false"
      inkscape:zoom="8.1166667"
-     inkscape:cx="-5.2360641"
-     inkscape:cy="9.3591473"
-     inkscape:window-x="714"
-     inkscape:window-y="196"
+     inkscape:cx="5.786692"
+     inkscape:cy="11.921211"
+     inkscape:window-x="726"
+     inkscape:window-y="215"
      inkscape:window-maximized="0"
-     inkscape:current-layer="svg3256" /><g
+     inkscape:current-layer="svg3235" /><g
      id="inspiration"
      display="none" /><g
      id="labels" /><g
-     id="icons"><line
+     id="icons"><polygon
+       fill="#FFFFFF"
+       points="9,17.502 5,14.502 9,11.5  "
+       id="polygon3240" /><line
        fill="none"
        stroke="#FFFFFF"
        stroke-width="2"
        stroke-miterlimit="10"
-       x1="4"
-       y1="7"
-       x2="26"
-       y2="7"
-       id="line3261" /><line
+       x1="26"
+       y1="22"
+       x2="4"
+       y2="22"
+       id="line3242" /><line
        fill="none"
        stroke="#FFFFFF"
        stroke-width="2"
        stroke-miterlimit="10"
-       x1="12"
-       y1="12"
-       x2="26"
-       y2="12"
-       id="line3263" /><line
+       x1="26"
+       y1="17"
+       x2="12"
+       y2="17"
+       id="line3244" /><line
        fill="none"
        stroke="#FFFFFF"
        stroke-width="2"
        stroke-miterlimit="10"
-       x1="12"
-       y1="17"
-       x2="26"
-       y2="17"
-       id="line3265" /><line
+       x1="26"
+       y1="12"
+       x2="12"
+       y2="12"
+       id="line3246" /><line
        fill="none"
        stroke="#FFFFFF"
        stroke-width="2"
        stroke-miterlimit="10"
-       x1="4"
-       y1="22"
-       x2="26"
-       y2="22"
-       id="line3267" /><polygon
-       fill="#FFFFFF"
-       points="4,11.5 8,14.5 4,17.502  "
-       id="polygon3269" /></g></svg>
+       x1="26"
+       y1="7"
+       x2="4"
+       y2="7"
+       id="line3248" /></g></svg>