Skip to content

Commit

Permalink
Fixed Autocomplete in mobile view. Optimized same-page link handling …
Browse files Browse the repository at this point in the history
…in pe-ap.js.
  • Loading branch information
Paul Jackson authored and Paul Jackson committed Aug 27, 2012
1 parent aeb7d23 commit 33f7095
Show file tree
Hide file tree
Showing 10 changed files with 320 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build/js/pe-ap-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/js/polyfills/datalist-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions demos/index-eng.html
Expand Up @@ -107,7 +107,7 @@ <h1 id="wb-cont">Working examples</h1>
</ul>
</section>

<section><h2 id="footnotes">Accessibile footnotes</h2>
<section><h2 id="footnotes">Accessible footnotes</h2>
<ul>
<li><a href="footnotes/footnotes-eng.html"><span class="wb-invisible">Accessibile footnotes - </span>English examples</a></li>
<li><a href="footnotes/footnotes-fra.html"><span class="wb-invisible">Accessibile footnotes - </span>French examples</a></li>
Expand All @@ -121,7 +121,7 @@ <h1 id="wb-cont">Working examples</h1>
</ul>
</section>

<section><h2 id="autocomplete">Auto-complete for text input fields (datalist polyfill) (Alpha)</h2>
<section><h2 id="autocomplete">Auto-complete for text input fields (datalist polyfill)</h2>
<ul>
<li><a href="datalist/datalist-eng.html"><span class="wb-invisible">Auto-complete for text input fields (datalist polyfill) - </span>English example</a></li>
<li><a href="datalist/datalist-fra.html"><span class="wb-invisible">Auto-complete for text input fields (datalist polyfill) - </span>French example</a></li>
Expand Down
2 changes: 1 addition & 1 deletion demos/index-fra.html
Expand Up @@ -267,7 +267,7 @@ <h1 id="wb-cont">Exemples pratiques</h1>
</ul>
</section>

<section><h2 id="autocomplete">Remplissage automatique des champs de saisie (correctif pour datalist) (Alpha)</h2>
<section><h2 id="autocomplete">Remplissage automatique des champs de saisie (correctif pour datalist)</h2>
<ul>
<li><a href="datalist/datalist-eng.html"><span class="wb-invisible">Remplissage automatique des champs de saisie (correctif pour datalist) - </span>English example</a></li>
<li><a href="datalist/datalist-fra.html"><span class="wb-invisible">Remplissage automatique des champs de saisie (correctif pour datalist) - </span>French example</a></li>
Expand Down
12 changes: 9 additions & 3 deletions src/js/pe-ap.js
Expand Up @@ -62,9 +62,15 @@
// Identify whether or not the device supports JavaScript and has a touchscreen
$('html').removeClass('no-js').addClass(wet_boew_theme !== null ? wet_boew_theme.theme : "").addClass(pe.touchscreen ? 'touchscreen' : '');

hlinks = pe.main.find("a").filter("[href*='#']");
hlinks_other = hlinks.filter(":not([href^='#'])"); // Other page links with hashes
hlinks_same = hlinks.filter("[href^='#']"); // Same page links with hashes
hlinks = pe.main.find("a").filter(function () {
return this.href.indexOf('#') !== -1;
});
hlinks_other = hlinks.filter(function () {
return this.href.indexOf('#') !== 0; // Other page links with hashes
});
hlinks_same = hlinks.filter(function () {
return this.href.indexOf('#') === 0; // Same page links with hashes
});

// Is this a mobile device?
if (pe.mobilecheck()) {
Expand Down
7 changes: 2 additions & 5 deletions src/js/polyfills/datalist.js
Expand Up @@ -43,7 +43,7 @@
};

correctWidth = function () {
container.css('min-width', elm.innerWidth());
autolist.css('width', elm.innerWidth());
if (pe.ie > 0 && pe.ie < 8) {
autolist.css('top', elm.innerHeight() + 13);
}
Expand All @@ -62,14 +62,11 @@
});

elm.attr({"role": "combobox", "aria-expanded": "false", "aria-autocomplete": "list", "aria-owns": "wb-autolist-" + index}).wrap('<div class="wb-al-container"/>');
container = elm.parent().css('min-width', elm.innerWidth());

autolist = $('<ul role="listbox" id="wb-autolist-' + index + '" class="wb-autolist al-hide" aria-hidden="true">' + datalist_items.join('') + '</ul>');
options = autolist.find('li');
elm.after(autolist);
if (pe.ie > 0 && pe.ie < 8) {
autolist.css('top', elm.innerHeight() + 13);
}
correctWidth();

elm.on('keyup keydown click vclick', function (e) {
var type = e.type,
Expand Down
90 changes: 90 additions & 0 deletions src/js/workers/run-charts-complex.csv
@@ -0,0 +1,90 @@
1345950103672, Start init function
1345950103673, Start hlinks desktop fix
1345950103673, End hlinks desktop fix
1345950103673, Start AJAX in of content
1345950103696, Done AJAX in of content
1345950103773, Start theme init
1345950103773, Start navcurrent
1345950103780, End navcurrent
1345950103781, End theme init
1345950103781, Start DOM swarm
1345950103782, End DOM swarm
1345950103782, Start poly and dep array push
1345950103782, End poly and dep array push
1345950103783, Start polyload
1345950103783, End polyload
1345950103794, Polyfill init start
1345950103794, Polyfill init end
1345950103794, Polyfill dependency push start
1345950103794, Polyfill dependency push end
1345950103870, Start polyload
1345950103871, End polyload
1345950103871, Start polyfill depend init
1345950103871, End polyfill depend init
1345950103871, Start plugin calls
1345950103871, Start menubar plugin call
1345950103922, End menubar plugin call
1345950103922, Start charts plugin call
1345950104127, End charts plugin call, 205ms execution time
1345950104127, Start charts plugin call
1345950104130, End charts plugin call, 3ms execution time
1345950104130, Start charts plugin call
1345950104131, End charts plugin call, 1ms execution time
1345950104131, Start charts plugin call
1345950104131, End charts plugin call, 0ms execution time
1345950104131, Start charts plugin call
1345950104132, End charts plugin call, 1ms execution time
1345950104132, Start charts plugin call
1345950104133, End charts plugin call, 1ms execution time
1345950104133, Start charts plugin call
1345950104134, End charts plugin call, 1ms execution time
1345950104134, End plugin calls
1345950104134, Start global plugin calls
1345950104135, End global plugin calls



Cached:
1345950158368, Start init function
1345950158371, Start hlinks desktop fix
1345950158371, End hlinks desktop fix
1345950158371, Start AJAX in of content
1345950158374, Done AJAX in of content
1345950158432, Start theme init
1345950158433, Start navcurrent
1345950158434, End navcurrent
1345950158434, End theme init
1345950158434, Start DOM swarm
1345950158437, End DOM swarm
1345950158437, Start poly and dep array push
1345950158437, End poly and dep array push
1345950158437, Start polyload
1345950158438, End polyload
1345950158475, Polyfill init start
1345950158475, Polyfill init end
1345950158475, Polyfill dependency push start
1345950158475, Polyfill dependency push end
1345950158554, Start polyload
1345950158554, End polyload
1345950158554, Start polyfill depend init
1345950158554, End polyfill depend init
1345950158554, Start plugin calls
1345950158555, Start menubar plugin call
1345950158567, End menubar plugin call
1345950158567, Start charts plugin call
1345950158774, End charts plugin call, 207ms execution time
1345950158774, Start charts plugin call
1345950158777, End charts plugin call, 3ms execution time
1345950158777, Start charts plugin call
1345950158778, End charts plugin call, 1ms execution time
1345950158778, Start charts plugin call
1345950158779, End charts plugin call, 1ms execution time
1345950158779, Start charts plugin call
1345950158779, End charts plugin call, 0ms execution time
1345950158779, Start charts plugin call
1345950158780, End charts plugin call, 1ms execution time
1345950158780, Start charts plugin call
1345950158781, End charts plugin call, 1ms execution time
1345950158781, End plugin calls
1345950158781, Start global plugin calls
1345950158782, End global plugin calls
82 changes: 82 additions & 0 deletions src/js/workers/run-charts.csv
@@ -0,0 +1,82 @@
1345949985994, Start init function
1345949985997, Start hlinks desktop fix
1345949985997, End hlinks desktop fix
1345949985997, Start AJAX in of content
1345949986017, Done AJAX in of content
1345949986104, Start theme init
1345949986105, Start navcurrent
1345949986112, End navcurrent
1345949986113, End theme init
1345949986113, Start DOM swarm
1345949986114, End DOM swarm
1345949986114, Start poly and dep array push
1345949986114, End poly and dep array push
1345949986114, Start polyload
1345949986115, End polyload
1345949986130, Polyfill init start
1345949986130, Polyfill init end
1345949986130, Polyfill dependency push start
1345949986130, Polyfill dependency push end
1345949986204, Start polyload
1345949986204, End polyload
1345949986205, Start polyfill depend init
1345949986205, End polyfill depend init
1345949986205, Start plugin calls
1345949986205, Start menubar plugin call
1345949986256, End menubar plugin call
1345949986256, Start charts plugin call
1345949986381, End charts plugin call, 125ms execution time
1345949986381, Start charts plugin call
1345949986383, End charts plugin call, 2ms execution time
1345949986383, Start charts plugin call
1345949986384, End charts plugin call, 1ms execution time
1345949986384, Start charts plugin call
1345949986385, End charts plugin call, 1ms execution time
1345949986385, Start charts plugin call
1345949986386, End charts plugin call, 1ms execution time
1345949986386, End plugin calls
1345949986386, Start global plugin calls
1345949986387, End global plugin calls



Cached:
1345950048424, Start init function
1345950048426, Start hlinks desktop fix
1345950048426, End hlinks desktop fix
1345950048426, Start AJAX in of content
1345950048429, Done AJAX in of content
1345950048485, Start theme init
1345950048486, Start navcurrent
1345950048487, End navcurrent
1345950048487, End theme init
1345950048487, Start DOM swarm
1345950048490, End DOM swarm
1345950048490, Start poly and dep array push
1345950048490, End poly and dep array push
1345950048490, Start polyload
1345950048490, End polyload
1345950048524, Polyfill init start
1345950048524, Polyfill init end
1345950048524, Polyfill dependency push start
1345950048524, Polyfill dependency push end
1345950048598, Start polyload
1345950048598, End polyload
1345950048599, Start polyfill depend init
1345950048599, End polyfill depend init
1345950048599, Start plugin calls
1345950048599, Start menubar plugin call
1345950048610, End menubar plugin call
1345950048610, Start charts plugin call
1345950048737, End charts plugin call, 127ms execution time
1345950048737, Start charts plugin call
1345950048739, End charts plugin call, 2ms execution time
1345950048739, Start charts plugin call
1345950048740, End charts plugin call, 1ms execution time
1345950048740, Start charts plugin call
1345950048741, End charts plugin call, 1ms execution time
1345950048741, Start charts plugin call
1345950048742, End charts plugin call, 1ms execution time
1345950048742, End plugin calls
1345950048742, Start global plugin calls
1345950048743, End global plugin calls
66 changes: 66 additions & 0 deletions src/js/workers/run-footnotes.csv
@@ -0,0 +1,66 @@
1345950560554, Start init function
1345950560557, Start hlinks desktop fix
1345950560558, End hlinks desktop fix
1345950560558, Start AJAX in of content
1345950560579, Done AJAX in of content
1345950560657, Start theme init
1345950560658, Start navcurrent
1345950560664, End navcurrent
1345950560665, End theme init
1345950560665, Start DOM swarm
1345950560666, End DOM swarm
1345950560666, Start poly and dep array push
1345950560666, End poly and dep array push
1345950560666, Start polyload
1345950560667, End polyload
1345950560667, Polyfill init start
1345950560667, Polyfill init end
1345950560667, Polyfill dependency push start
1345950560667, Polyfill dependency push end
1345950560686, Start polyload
1345950560686, End polyload
1345950560686, Start polyfill depend init
1345950560686, End polyfill depend init
1345950560686, Start plugin calls
1345950560687, Start menubar plugin call
1345950560737, End menubar plugin call
1345950560737, Start footnotes plugin call
1345950560739, End footnotes plugin call, (2ms execution time)
1345950560739, End plugin calls
1345950560739, Start global plugin calls
1345950560741, End global plugin calls



Cached:
1345950608927, Start init function
1345950608931, Start hlinks desktop fix
1345950608932, End hlinks desktop fix
1345950608932, Start AJAX in of content
1345950608935, Done AJAX in of content
1345950608996, Start theme init
1345950608997, Start navcurrent
1345950608998, End navcurrent
1345950608998, End theme init
1345950608999, Start DOM swarm
1345950609000, End DOM swarm
1345950609000, Start poly and dep array push
1345950609000, End poly and dep array push
1345950609000, Start polyload
1345950609001, End polyload
1345950609001, Polyfill init start
1345950609001, Polyfill init end
1345950609001, Polyfill dependency push start
1345950609001, Polyfill dependency push end
1345950609039, Start polyload
1345950609039, End polyload
1345950609039, Start polyfill depend init
1345950609039, End polyfill depend init
1345950609039, Start plugin calls
1345950609039, Start menubar plugin call
1345950609051, End menubar plugin call
1345950609051, Start footnotes plugin call
1345950609052, End footnotes plugin call, (1ms execution time)
1345950609052, End plugin calls
1345950609052, Start global plugin calls
1345950609055, End global plugin calls

0 comments on commit 33f7095

Please sign in to comment.