Coder Social home page Coder Social logo

Comments (6)

oliverfoster avatar oliverfoster commented on June 26, 2024

https://github.com/cgkineo/adapt-articleBlockSlider/blob/master/js/adapt-articleView.js#L111

_title: blocks[i].get('title') || blocks[i].get('displayTitle')

from adapt-articleblockslider.

jamesrea83 avatar jamesrea83 commented on June 26, 2024

Unfortunately that doesn't help- _title is being used by both aria-label & item-button-inner

<button class="base item-button {{_className}}" aria-label="{{_title}}" data-block-slider="index" data-block-slider-index="{{this._index}}"><span class="item-button-inner">{{_title}}</span></button>

from adapt-articleblockslider.

moloko avatar moloko commented on June 26, 2024

Might as well have a bit of a tidy up at the same time...!

_blockSliderConfigureVariables: function() {
  var blocks = this.model.getChildren().models;
  var itemButtons = [];
  
  blocks.forEach(function(block, i) {
    itemButtons.push({
      _className: (i === 0 ? 'home' : 'not-home') + (' i'+i),
      _index: i,
      _includeNumber: i !== 0,
      _title: block.get('title')
    });
  });
  
  this.model.set({
    _currentBlock: 0,
    _totalBlocks: blocks.length,
    _itemButtons: itemButtons
  });
}

how about this for the template?

<button class="base item-button {{_className}}" aria-label="{{#if _title}}{{_title}}{{else}}{{inc _index}}/{{../totalBlocks}}{{/if}}" data-block-slider="index" data-block-slider-index="{{this._index}}"></button>

from adapt-articleblockslider.

moloko avatar moloko commented on June 26, 2024

oh, hang on - is this the one where the item-button is used both for the progress dots and for the tab buttons??

from adapt-articleblockslider.

moloko avatar moloko commented on June 26, 2024

just to note the navigation dots are something that were created for a specific project/client and I don't think are normally supported by the out-of-the-box ABS - so not sure this ticket is necessarily relevant (here)

from adapt-articleblockslider.

moloko avatar moloko commented on June 26, 2024

although note that this feature has been requested in #40 - but I think if we do that we should do it differently to what @jamesrea83 is looking at

from adapt-articleblockslider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.