Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it really work without prefix #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions dist/leaflet-vector-markers.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ Version: 0.0.6
height: 40%;
position: absolute;
right: 21px;
-webkit-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
-webkit-transform: skew(150deg) rotate(-40deg);
-ms-transform: skew(150deg) rotate(-40deg);
transform: skew(150deg) rotate(-40deg);
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
-ms-transform: skew(150deg) rotate(-40deg);
transform: skew(150deg) rotate(-40deg);
width: 60%;
z-index: -1; }

Expand Down
30 changes: 15 additions & 15 deletions dist/leaflet-vector-markers.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ return /******/ (function(modules) { // webpackBootstrap
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier 'webpack_require' is not in camel case.
Wrapping non-IIFE function literals in parens is unnecessary.


'use strict';

Expand Down Expand Up @@ -81,15 +81,15 @@ return /******/ (function(modules) { // webpackBootstrap

_leaflet2.default.VectorMarkers = _VectorMarkers3.default;

/***/ },
/***/ }),
/* 1 */
/***/ function(module, exports) {
/***/ (function(module, exports) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'exports' is defined but never used.
Wrapping non-IIFE function literals in parens is unnecessary.


module.exports = __WEBPACK_EXTERNAL_MODULE_1__;

/***/ },
/***/ }),
/* 2 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier 'webpack_require' is not in camel case.
Wrapping non-IIFE function literals in parens is unnecessary.


'use strict';

Expand All @@ -113,9 +113,9 @@ return /******/ (function(modules) { // webpackBootstrap
}
};

/***/ },
/***/ }),
/* 3 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identifier 'webpack_require' is not in camel case.


'use strict';

Expand Down Expand Up @@ -162,7 +162,7 @@ return /******/ (function(modules) { // webpackBootstrap
function Icon(options) {
_classCallCheck(this, Icon);

var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Icon).call(this, options));
var _this = _possibleConstructorReturn(this, (Icon.__proto__ || Object.getPrototypeOf(Icon)).call(this, options));

_leaflet2.default.Util.setOptions(_this, iconOptions);
_leaflet2.default.Util.setOptions(_this, options);
Expand Down Expand Up @@ -200,14 +200,14 @@ return /******/ (function(modules) { // webpackBootstrap
var i = document.createElement('i');
var options = this.options;

i.classList.add(options.prefix);
if (options.extraClasses) {
if (options.extraClasses && typeof options.extraClasses === 'string') {
i.classList.add(options.extraClasses);
}
if (options.icon.slice(0, options.prefix.length + 1) === options.prefix + '-') {
i.classList.add(options.icon);
} else {
if (options.prefix && typeof options.prefix === 'string') {
i.classList.add(options.prefix + '-' + options.icon);
i.classList.add(options.prefix);
} else {
i.classList.add(options.icon);
}
if (options.spin && typeof options.spinClass === 'string') {
i.classList.add(options.spinClass);
Expand Down Expand Up @@ -256,7 +256,7 @@ return /******/ (function(modules) { // webpackBootstrap

exports.default = Icon;

/***/ }
/***/ })
/******/ ])
});
;
;
2 changes: 1 addition & 1 deletion dist/leaflet-vector-markers.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions lib/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var Icon = function (_Leaflet$Icon) {
function Icon(options) {
_classCallCheck(this, Icon);

var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Icon).call(this, options));
var _this = _possibleConstructorReturn(this, (Icon.__proto__ || Object.getPrototypeOf(Icon)).call(this, options));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.
The 'proto' property is deprecated.


_leaflet2.default.Util.setOptions(_this, iconOptions);
_leaflet2.default.Util.setOptions(_this, options);
Expand Down Expand Up @@ -81,14 +81,14 @@ var Icon = function (_Leaflet$Icon) {
var i = document.createElement('i');
var options = this.options;

i.classList.add(options.prefix);
if (options.extraClasses) {
if (options.extraClasses && typeof options.extraClasses === 'string') {
i.classList.add(options.extraClasses);
}
if (options.icon.slice(0, options.prefix.length + 1) === options.prefix + '-') {
i.classList.add(options.icon);
} else {
if (options.prefix && typeof options.prefix === 'string') {
i.classList.add(options.prefix + '-' + options.icon);
i.classList.add(options.prefix);
} else {
i.classList.add(options.icon);
}
if (options.spin && typeof options.spinClass === 'string') {
i.classList.add(options.spinClass);
Expand Down
6 changes: 3 additions & 3 deletions src/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ export default class Icon extends Leaflet.Icon {
const i = document.createElement('i')
const options = this.options

i.classList.add(options.prefix)
if (options.extraClasses) {
if (options.extraClasses && typeof options.extraClasses === 'string') {
i.classList.add(options.extraClasses)
}
if (options.prefix) {
if (options.prefix && typeof options.prefix === 'string') {
i.classList.add(options.prefix + '-' + options.icon)
i.classList.add(options.prefix)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

} else {
i.classList.add(options.icon)
}
Expand Down