|
4 | 4 | } else if (typeof exports === 'object') { |
5 | 5 | module.exports = factory(require('Notify')); |
6 | 6 | } else { |
7 | | - root.$wtNotify = factory(root.Notify); |
| 7 | + root.wtGenius = factory(root.Notify); |
8 | 8 | } |
9 | 9 | }(this, function(Notify) { |
10 | | -var $wtNotify = angular.module('wt.genius', []); |
| 10 | +var wtGenius = angular.module('wt.genius', []); |
11 | 11 | /** |
12 | 12 | * $wtNotify |
13 | 13 | * |
@@ -97,36 +97,33 @@ angular.module('wt.genius') |
97 | 97 | * Version: 1.0.0 - 2015-10-19 |
98 | 98 | * Anthor: zhenshuai |
99 | 99 | */ |
100 | | -(function () { |
101 | | - 'use strict'; |
102 | | - angular.module('wt.genius') |
103 | | - .provider('$wtRetina', [function () { |
104 | | - var defaults = { |
105 | | - onchange: function () { |
106 | | - //console.log('dpi 切换事件'); |
107 | | - } |
108 | | - }; |
109 | | - var configOptions = {}; |
110 | | - this.config = function (value) { |
111 | | - configOptions = value; |
112 | | - }; |
113 | | - this.$get = [ |
114 | | - function () { |
115 | | - var mediaQuery = "(min--moz-device-pixel-ratio: 1.5),\ |
| 100 | +angular.module('wt.genius') |
| 101 | + .provider('$wtRetina', [function () { |
| 102 | + var defaults = { |
| 103 | + onchange: function () { |
| 104 | + //console.log('dpi 切换事件'); |
| 105 | + } |
| 106 | + }; |
| 107 | + var configOptions = {}; |
| 108 | + this.config = function (value) { |
| 109 | + configOptions = value; |
| 110 | + }; |
| 111 | + this.$get = [ |
| 112 | + function () { |
| 113 | + var mediaQuery = "(min--moz-device-pixel-ratio: 1.5),\ |
116 | 114 | (-o-min-device-pixel-ratio: 3/2),\ |
117 | 115 | (-webkit-min-device-pixel-ratio: 1.5),\ |
118 | 116 | (min-device-pixel-ratio: 1.5),\ |
119 | 117 | (min-resolution: 144dpi),\ |
120 | 118 | (min-resolution: 1.5dppx)"; |
121 | 119 |
|
122 | | - var matchObj = window.matchMedia(mediaQuery); |
123 | | - return { |
124 | | - isRetina: matchObj.matches, |
125 | | - media : matchObj.media |
126 | | - }; |
127 | | - } |
128 | | - ]; |
129 | | - }]); |
130 | | -})(); |
131 | | -return $wtNotify; |
| 120 | + var matchObj = window.matchMedia(mediaQuery); |
| 121 | + return { |
| 122 | + isRetina: matchObj.matches, |
| 123 | + media : matchObj.media |
| 124 | + }; |
| 125 | + } |
| 126 | + ]; |
| 127 | + }]); |
| 128 | +return wtGenius; |
132 | 129 | })); |
0 commit comments