Skip to content

Commit

Permalink
Use gh actions (#557)
Browse files Browse the repository at this point in the history
* Remove travis and use github actions

* Fix code style
  • Loading branch information
Trufi authored Dec 14, 2021
1 parent 7865453 commit ce016b5
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 26 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test
on: push

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Setup node 🔧
uses: actions/setup-node@v2
with:
node-version: 12

- name: Test ✔️
run: |
npm ci
npm test
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# API карт 2GIS [![Build Status][build-badge]][build-link] [![Coverage Status][coverage-badge]][coverage-link] [![npm][npm-badge]][npm-link]

[build-badge]: https://travis-ci.org/2gis/mapsapi.svg?branch=master
[build-link]: https://travis-ci.org/2gis/mapsapi

[coverage-badge]: https://img.shields.io/coveralls/2gis/mapsapi.svg?branch=master&service=github
[coverage-link]: https://coveralls.io/r/2gis/mapsapi
# API карт 2GIS [![npm][npm-badge]][npm-link]

[npm-badge]: https://img.shields.io/npm/v/2gis-maps.svg
[npm-link]: https://www.npmjs.com/package/2gis-maps
Expand Down
23 changes: 12 additions & 11 deletions src/DGAttribution/src/DGAttribution.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DG.Control.Attribution.include({
position: 'bottomright'
},

_getLink: function (linkType) {
_getLink: function(linkType) {
/* eslint-disable camelcase */
var dictionary = {
ru: {
Expand Down Expand Up @@ -70,17 +70,18 @@ DG.Control.Attribution.include({

this._update();

var self = this;
DG.DomEvent
.on(this._container, 'touchstart', (e) => {
if (e.target.href === this._open2gis) {
this._open2gis = this._getOpenUrl();
e.target.href = this._open2gis
.on(this._container, 'touchstart', function(e) {
if (e.target.href === self._open2gis) {
self._open2gis = self._getOpenUrl();
e.target.href = self._open2gis
}
})
return this._container;
},

_update: function (lang, osm, countryCode) {
_update: function(lang, osm, countryCode) {
if (!this._map) { return; }

this._open2gis = this._getOpenUrl();
Expand Down Expand Up @@ -118,7 +119,7 @@ DG.Control.Attribution.include({
this._container.innerHTML = copyright + prefixAndAttribs.join(' | ');

},
_getOpenUrl: function () {
_getOpenUrl: function() {
if (!this._map.projectDetector) {
return '';
}
Expand All @@ -133,7 +134,7 @@ DG.Control.Attribution.include({
'zoom': this._map.getZoom(),
});
},
_getData: function (lang) {
_getData: function(lang) {
lang = lang || this._map.getLang();
var btn =
{
Expand All @@ -155,15 +156,15 @@ DG.Control.Attribution.include({
'btn': btn
};
},
_getAttributionHTML: function (lang) {
_getAttributionHTML: function(lang) {
return DG.dust('DGAttribution/copyright', this._getData(lang));
},
_renderTranslation: function (e) {
_renderTranslation: function(e) {
this._update(e.lang);
}
});

DG.Map.addInitHook(function () {
DG.Map.addInitHook(function() {
if (!this._copyright) {
DG.control.attribution().addTo(this);
}
Expand Down

0 comments on commit ce016b5

Please sign in to comment.