Skip to content

Commit

Permalink
Merge pull request #48 from OrcaSlide/develop
Browse files Browse the repository at this point in the history
[Pull Request] develop into master
  • Loading branch information
the-kolibri committed Sep 4, 2018
2 parents 1c56dbf + 6c26f70 commit 2691fc4
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# npm ignores

source/
test/
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Orca Slide

[![OrcaSlide badge](https://img.shields.io/badge/OrcaSlide-Develop-yellow.svg)](https://github.com/konami12/orcaslide)
[![OrcaSlide badge](https://img.shields.io/badge/OrcaSlide-Stable-green.svg)](https://github.com/konami12/orcaslide)

[![GitHub version](https://badge.fury.io/gh/konami12%2Forcaslide.svg)](https://badge.fury.io/gh/konami12%2Forcaslide)

Expand Down Expand Up @@ -67,12 +67,12 @@ el paquete, a futuro se tiene contemplado permitir el manejo de más configuraci
/*
* esto indica si el evento se realiza al pasar el slider.
* por defecto el valor es false,
**/
**/
next: true,
/*
* esto indica si el evento se realiza al retroceder un slider.
* por defecto el valor es false,
**/
**/
previus: true,
},
{
Expand All @@ -97,7 +97,7 @@ el paquete, a futuro se tiene contemplado permitir el manejo de más configuraci
};
```

> **Nota:** Al pasar
> **Nota:** Al pasar

## 🚧 Estructura HTML
Expand Down Expand Up @@ -171,6 +171,12 @@ Nuestra estructura básica de HTML para correr el OrcaSlider consta de las sigui
</section><!-- /Slider -->

```
## 🏗️ Changelog

#### v1.0.2

* Se estandariza funcionalidad de las **flechas** entre Slider y Carouseles
* Se **optimiza la carga** de la funcionalidad de Orcaslide cuando es inocada

## 🌎 Team

Expand All @@ -184,4 +190,4 @@ Nuestra estructura básica de HTML para correr el OrcaSlider consta de las sigui
</center>


[![Readme Version](https://img.shields.io/badge/Readme-v0.0.1-red.svg)](https://github.com/the-kolibri)
[![Readme Version](https://img.shields.io/badge/Readme-v0.0.2-green.svg)](https://github.com/the-kolibri)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "orcaslide",
"version": "1.0.1",
"version": "1.0.2",
"description": "Slide basico",
"contributors": [
{
Expand Down
5 changes: 3 additions & 2 deletions source/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ class Utils {
*/
static displayToggle(element, display = "") {
const ELEMENT = element;
const PARENT = element.parentNode || ELEMENT;
let auxDisplay = display;

if (display !== "") {
const DISPLAY = ELEMENT.style.display || "block";
const DISPLAY = PARENT.style.display || "block";
auxDisplay = (DISPLAY === "block") ? "none" : "";
}
ELEMENT.style.display = auxDisplay;
PARENT.style.display = auxDisplay;
}

/**
Expand Down
32 changes: 28 additions & 4 deletions source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,34 @@ import Config from "./orcaConfig.json";
*/
class initOrcaSlide {
static set config(config) {
const CONFIG = JSON.stringify(Config);
const NEW_CONFIG = JSON.parse(CONFIG);
Object.assign(NEW_CONFIG, config);
return new OrcaSlide(NEW_CONFIG);
this.buildOrcaStorage(config);
document.onreadystatechange = () => {
if (document.readyState === "complete") {
const ORCAS = JSON.parse(localStorage.orcaslide);
ORCAS.map((orca) => {
const CONFIG = JSON.stringify(Config);
const NEW_CONFIG = JSON.parse(CONFIG);
Object.assign(NEW_CONFIG, orca);
return new OrcaSlide(NEW_CONFIG);
});
delete localStorage.orcaslide;
}
};
}

/**
* Permite crear un storage con las invocaciones de orca.
*
* @param {object} config Configuracion base.
* @return {void}
*/
static buildOrcaStorage(config) {
if (!localStorage.orcaslide) {
localStorage.orcaslide = "[]";
}
const STORAGE = JSON.parse(localStorage.orcaslide);
STORAGE.push(config);
localStorage.orcaslide = JSON.stringify(STORAGE);
}
}

Expand Down

0 comments on commit 2691fc4

Please sign in to comment.