Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Default Back button with no text #1744

Closed
StingerID4 opened this issue May 31, 2011 · 1 comment
Closed

Default Back button with no text #1744

StingerID4 opened this issue May 31, 2011 · 1 comment

Comments

@StingerID4
Copy link

I wanted my default back button to not have any text, just an icon. Turns out you need to add "iconpos='notext'" to a link with no text. Apperantly you can't set this in the options or anything like that. So I put it myself in the code.

I just added to the '_create' function of 'mobile.page' to check if there is no text in the 'backBtnText' variable, then add the iconpos attribute to the a tag.

Perhaps you could use something likewise in a future version?

I changed
var backBtn = $( "<a href='#' class='ui-btn-left' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='arrow-l'>"+ o.backBtnText +"</a>" ).prependTo( $this );
to
var backBtn = $( "<a href='#' class='ui-btn-left' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='arrow-l' " + (!o.backBtnText ? "data-iconpos='notext'" : "") + ">"+ o.backBtnText +"</a>" ).prependTo( $this );

@toddparker
Copy link
Contributor

Added to the feature request wiki:
https://github.com/jquery/jquery-mobile/wiki/Feature-Requests

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants