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

Commit 6b5d7b7

Browse files
author
Gabriel Schulhof
committed
[listview] Remove functions and calls related to corner manipulation
1 parent 93a6817 commit 6b5d7b7

File tree

2 files changed

+1
-69
lines changed

2 files changed

+1
-69
lines changed

js/widgets/listview.filter.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ $( document ).delegate( "ul, ol", "listviewcreate", function() {
114114
//filtervalue is empty => show all
115115
listItems.toggleClass( "ui-screen-hidden", !!listview.options.filterReveal );
116116
}
117-
listview._refreshCorners();
118117
})
119118
.appendTo( wrapper )
120119
.textinput();

js/widgets/listview.js

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -42,71 +42,6 @@ $.widget( "mobile.listview", $.mobile.widget, {
4242
t.refresh( true );
4343
},
4444

45-
_removeCorners: function( li, which ) {
46-
var top = "ui-corner-top ui-corner-tr ui-corner-tl",
47-
bot = "ui-corner-bottom ui-corner-br ui-corner-bl";
48-
49-
li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );
50-
51-
if ( which === "top" ) {
52-
li.removeClass( top );
53-
} else if ( which === "bottom" ) {
54-
li.removeClass( bot );
55-
} else {
56-
li.removeClass( top + " " + bot );
57-
}
58-
},
59-
60-
_refreshCorners: function( create ) {
61-
var $li,
62-
$visibleli,
63-
$topli,
64-
$bottomli;
65-
66-
$li = this.element.children( "li" );
67-
// At create time and when autodividers calls refresh the li are not visible yet so we need to rely on .ui-screen-hidden
68-
$visibleli = create || $li.filter( ":visible" ).length === 0 ? $li.not( ".ui-screen-hidden" ) : $li.filter( ":visible" );
69-
70-
// ui-li-last is used for setting border-bottom on the last li
71-
$li.filter( ".ui-li-last" ).removeClass( "ui-li-last" );
72-
73-
if ( this.options.inset ) {
74-
this._removeCorners( $li );
75-
76-
// Select the first visible li element
77-
$topli = $visibleli.first()
78-
.addClass( "ui-corner-top" );
79-
80-
$topli.add( $topli.find( ".ui-btn-inner" )
81-
.not( ".ui-li-link-alt span:first-child" ) )
82-
.addClass( "ui-corner-top" )
83-
.end()
84-
.find( ".ui-li-link-alt, .ui-li-link-alt span:first-child" )
85-
.addClass( "ui-corner-tr" )
86-
.end()
87-
.find( ".ui-li-thumb" )
88-
.not( ".ui-li-icon" )
89-
.addClass( "ui-corner-tl" );
90-
91-
// Select the last visible li element
92-
$bottomli = $visibleli.last()
93-
.addClass( "ui-corner-bottom ui-li-last" );
94-
95-
$bottomli.add( $bottomli.find( ".ui-btn-inner" ) )
96-
.find( ".ui-li-link-alt" )
97-
.addClass( "ui-corner-br" )
98-
.end()
99-
.find( ".ui-li-thumb" )
100-
.not( ".ui-li-icon" )
101-
.addClass( "ui-corner-bl" );
102-
} else {
103-
$visibleli.last().addClass( "ui-li-last" );
104-
}
105-
if ( !create ) {
106-
this.element.trigger( "updatelayout" );
107-
}
108-
},
109-
11045
// This is a generic utility method for finding the first
11146
// node with a given nodeName. It uses basic DOM traversal
11247
// to be fast and is meant to be a substitute for simple
@@ -337,9 +272,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
337272
this._addThumbClasses( li );
338273
this._addThumbClasses( $list.find( ".ui-link-inherit" ) );
339274

340-
this._refreshCorners( create );
341-
342-
// autodividers binds to this to redraw dividers after the listview refresh
275+
// autodividers binds to this to redraw dividers after the listview refresh
343276
this._trigger( "afterrefresh" );
344277
},
345278

0 commit comments

Comments
 (0)