A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/vuematerial/vue-material/commit/a591144 below:

emit selected/update event only when selected items rea… · vuematerial/vue-material@a591144 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+21

-4

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+21

-4

lines changed Original file line number Diff line number Diff line change

@@ -222,11 +222,28 @@

222 222

this.MdTable.hasValue = this.hasValue

223 223

}

224 224

},

225 -

'MdTable.selectedItems' (val) {

226 -

this.select(val)

225 +

'MdTable.selectedItems' (val, old) {

226 +

let changed = (() => {

227 +

let isValEmpty = !val || val.length === 0

228 +

let isOldEmpty = !old || old.length === 0

229 + 230 +

if (isValEmpty && isOldEmpty) {

231 +

return false

232 +

} else if (!isValEmpty && !isOldEmpty) {

233 +

return (val.length !== old.length) ? true : !val.every((item, index) => item == old[index])

234 +

} else {

235 +

return true

236 +

}

237 +

})()

238 + 239 +

if (changed) {

240 +

this.select(val)

241 +

}

227 242

},

228 -

'MdTable.singleSelection' (val) {

229 -

this.select(val)

243 +

'MdTable.singleSelection' (val, old) {

244 +

if (val != old) {

245 +

this.select(val)

246 +

}

230 247

},

231 248

mdSelectedValue () {

232 249

this.syncSelectedValue()

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4