~halvdanhg/dhis2/message-fixes

« back to all changes in this revision

Viewing changes to dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/mapfish/core/GeoStat/all.js

  • Committer: Halvdan Hoem Grelland
  • Date: 2015-01-12 12:29:11 UTC
  • mfrom: (17924.2.17 dhis2)
  • Revision ID: halvdanhg@gmail.com-20150112122911-1xg4pwmjblq30cbg
mwt

Show diffs side-by-side

added added

removed removed

Lines of Context:
723
723
                },
724
724
 
725
725
                updateLegend: function() {
726
 
                        var     element = document.createElement("div"),
 
726
                        var     view = this.view,
 
727
                response = this.gis.response,
 
728
                isPlugin = this.gis.plugin,
 
729
                element = document.createElement("div"),
 
730
                style = {},
727
731
                                child,
728
732
                id,
729
733
                name;
730
734
 
 
735
                style.dataLineHeight = isPlugin ? '12px' : '14px';
 
736
                style.dataPaddingBottom = isPlugin ? '1px' : '3px';
 
737
                style.colorWidth = isPlugin ? '15px' : '30px';
 
738
                style.colorHeight = isPlugin ? '13px' : '15px';
 
739
                style.colorMarginRight = isPlugin ? '5px' : '8px';
 
740
                style.fontSize = isPlugin ? '10px' : '11px';
 
741
 
731
742
                        // data
732
 
            id = this.view.columns[0].items[0].id;
733
 
            name = this.view.columns[0].items[0].name;
 
743
            id = view.columns[0].items[0].id;
 
744
            name = view.columns[0].items[0].name;
734
745
                        child = document.createElement("div");
735
 
            child.style.lineHeight = "14px";
736
 
            child.style.paddingBottom = "3px";
737
 
            child.innerHTML += this.gis.response.metaData.names[id] || name || id;
 
746
            child.style.lineHeight = style.dataLineHeight;
 
747
            child.style.paddingBottom = style.dataPaddingBottom;
 
748
            child.innerHTML += response.metaData.names[id] || name || id;
738
749
            child.innerHTML += "<br/>";
739
750
 
740
751
                        // period
741
 
            id = this.view.filters[0].items[0].id;
742
 
            name = this.view.filters[0].items[0].name;
743
 
            child.innerHTML += this.gis.response.metaData.names[id] || name || id;
 
752
            id = view.filters[0].items[0].id;
 
753
            name = view.filters[0].items[0].name;
 
754
            child.innerHTML += response.metaData.names[id] || name || id;
744
755
                        element.appendChild(child);
745
756
 
746
757
                        child = document.createElement("div");
748
759
                        element.appendChild(child);
749
760
 
750
761
                        // legends
751
 
                        if (this.view.legendSet) {
 
762
                        if (view.legendSet) {
752
763
                                for (var i = 0; i < this.classification.bins.length; i++) {
753
764
                                        child = document.createElement("div");
754
765
                                        child.style.backgroundColor = this.colorInterpolation[i].toHexString();
755
 
                                        child.style.width = "30px";
756
 
                                        child.style.height = this.view.legendSet.names[i] ? "25px" : "20px";
757
 
                                        child.style.cssFloat = "left";
758
 
                                        child.style.marginRight = "8px";
 
766
                                        child.style.width = style.colorWidth;
 
767
                                        child.style.height = view.legendSet.names[i] ? '25px' : style.colorHeight;
 
768
                                        child.style.cssFloat = 'left';
 
769
                                        child.style.marginRight = style.colorMarginRight;
759
770
                                        element.appendChild(child);
760
771
 
761
772
                                        child = document.createElement("div");
762
 
                                        child.style.lineHeight = this.view.legendSet.names[i] ? "12px" : "7px";
763
 
                                        child.innerHTML = '<b style="color:#222; font-size:10px !important">' + (this.view.legendSet.names[i] || '') + '</b><br/>' + this.classification.bins[i].label;
 
773
                                        child.style.lineHeight = view.legendSet.names[i] ? "12px" : "7px";
 
774
                                        child.innerHTML = '<b style="color:#222; font-size:10px !important">' + (view.legendSet.names[i] || '') + '</b><br/>' + this.classification.bins[i].label;
764
775
                                        element.appendChild(child);
765
776
 
766
777
                                        child = document.createElement("div");
772
783
                                for (var i = 0; i < this.classification.bins.length; i++) {
773
784
                                        child = document.createElement("div");
774
785
                                        child.style.backgroundColor = this.colorInterpolation[i].toHexString();
775
 
                                        child.style.width = "30px";
776
 
                                        child.style.height = "15px";
777
 
                                        child.style.cssFloat = "left";
778
 
                                        child.style.marginRight = "8px";
 
786
                                        child.style.width = style.colorWidth;
 
787
                                        child.style.height = style.colorHeight;
 
788
                                        child.style.cssFloat = 'left';
 
789
                                        child.style.marginRight = style.colorMarginRight;
779
790
                                        element.appendChild(child);
780
791
 
781
792
                                        child = document.createElement("div");