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

fix destroy method data-anchor #2790

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
   **|**   *7Kb gziped*   **|**   *Created by [@imac2](https://twitter.com/imac2)*

- [Live demo](http://alvarotrigo.com/fullPage/)
- [Wordpress theme](http://alvarotrigo.com/fullPage/utils/wordpress-y-theme.html)
- [Wordpress theme](http://alvarotrigo.com/fullPage/utils/wordpress.html)
- [fullpage.js Extensions](http://alvarotrigo.com/fullPage/extensions/)
- [Frequently Answered Questions](https://github.com/alvarotrigo/fullPage.js/wiki/FAQ---Frequently-Answered-Questions)

Expand Down Expand Up @@ -868,8 +868,7 @@ To see the list of recent changes, see [Releases section](https://github.com/alv
Want to build fullpage.js distribution files? Please see [Build Tasks](https://github.com/alvarotrigo/fullPage.js/wiki/Build-tasks)

# Resources
- [Wordpress theme 1](http://alvarotrigo.com/fullPage/utils/wordpress-y-theme.html)
- [Wordpress theme 2](http://alvarotrigo.com/fullPage/utils/wordpress.html)
- [Wordpress theme](http://alvarotrigo.com/fullPage/utils/wordpress.html)
- [CSS Easing Animation Tool - Matthew Lein](http://matthewlein.com/ceaser/) (useful to define the `easingcss3` value)
- [fullPage.js jsDelivr CDN](http://www.jsdelivr.com/#!jquery.fullpage)
- [fullPage.js plugin for October CMS](http://octobercms.com/plugin/freestream-parallax)
Expand Down
5 changes: 2 additions & 3 deletions README_SPANISH.md
Original file line number Diff line number Diff line change
Expand Up @@ -865,8 +865,7 @@ Solo disponible en ingles :)
Want to build fullpage.js distribution files? Please see [Build Tasks](https://github.com/alvarotrigo/fullPage.js/wiki/Build-tasks)

# Recursos
- [Template de Wordpress 1](http://alvarotrigo.com/fullPage/utils/wordpress-y-theme.html)
- [Template de Wordpress 2](http://alvarotrigo.com/fullPage/utils/wordpress.html)
- [Template de Wordpress](http://alvarotrigo.com/fullPage/utils/wordpress.html)
- [Herramienta de animacion de CSS Easing - Matthew Lein](http://matthewlein.com/ceaser/) (útil para definir la opción `easingcss3`)
- [fullPage.js jsDelivr CDN](http://www.jsdelivr.com/#!jquery.fullpage)
- [fullPage.js plugin para October CMS](http://octobercms.com/plugin/freestream-parallax)
Expand Down Expand Up @@ -970,4 +969,4 @@ Se concede permiso, de forma gratuita, a cualquier persona que obtenga una copia

El aviso de copyright anterior y este aviso de permiso se incluirán en todas las copias o partes sustanciales del Software.

EL SOFTWARE SE PROPORCIONA "TAL CUAL", SIN GARANTÍA DE NINGÚN TIPO, EXPRESA O IMPLÍCITA, INCLUYENDO PERO NO LIMITADO A GARANTÍAS DE COMERCIALIZACIÓN, IDONEIDAD PARA UN PROPÓSITO PARTICULAR Y NO INFRACCIÓN. EN NINGÚN CASO LOS AUTORES O TITULARES DEL COPYRIGHT SERÁN RESPONSABLES DE NINGUNA RECLAMACIÓN, DAÑOS U OTRAS RESPONSABILIDADES, YA SEA EN UNA ACCIÓN DE CONTRATO, AGRAVIO O CUALQUIER OTRO MOTIVO, QUE SURJA DE O EN CONEXIÓN CON EL SOFTWARE O EL USO U OTRO TIPO DE ACCIONES EN EL SOFTWARE
EL SOFTWARE SE PROPORCIONA "TAL CUAL", SIN GARANTÍA DE NINGÚN TIPO, EXPRESA O IMPLÍCITA, INCLUYENDO PERO NO LIMITADO A GARANTÍAS DE COMERCIALIZACIÓN, IDONEIDAD PARA UN PROPÓSITO PARTICULAR Y NO INFRACCIÓN. EN NINGÚN CASO LOS AUTORES O TITULARES DEL COPYRIGHT SERÁN RESPONSABLES DE NINGUNA RECLAMACIÓN, DAÑOS U OTRAS RESPONSABILIDADES, YA SEA EN UNA ACCIÓN DE CONTRATO, AGRAVIO O CUALQUIER OTRO MOTIVO, QUE SURJA DE O EN CONEXIÓN CON EL SOFTWARE O EL USO U OTRO TIPO DE ACCIONES EN EL SOFTWARE
13 changes: 12 additions & 1 deletion jquery.fullPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@

//flag to avoid very fast sliding for landscape sliders
var slideMoving = false;
//flag to remove the Dom attribute data-anchor
var anchorsDefinedByUser = true;

var isTouchDevice = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|playbook|silk|BlackBerry|BB10|Windows Phone|Tizen|Bada|webOS|IEMobile|Opera Mini)/);
var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0) || (navigator.maxTouchPoints));
Expand Down Expand Up @@ -621,6 +623,7 @@
*/
function setOptionsFromDOM(){
var sections = container.find(options.sectionSelector);
anchorsDefinedByUser = sections.filter('[data-anchor]').length == 0

//no anchors option? Checking for them in the DOM attributes
if(!options.anchors.length){
Expand Down Expand Up @@ -2778,7 +2781,15 @@
container.find('img[data-srcset]').each(function(){
setSrc($(this), 'srcset');
});

// remove data-anchor cache for jQuery.fn.data
container.find('[data-anchor]').each(function () {
$(this).removeData('anchor');
if (anchorsDefinedByUser) {
// remove the attribute for user-defind anchor
$(this).removeAttr('data-anchor');
}
});

$(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL).remove();

//removing inline styles
Expand Down