~noskcaj/ubuntu/trusty/gnome-documents/3.10.2

« back to all changes in this revision

Viewing changes to src/searchbar.js

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson, Jeremy Bicha
  • Date: 2013-06-17 22:24:54 UTC
  • mfrom: (3.1.5 experimental)
  • Revision ID: package-import@ubuntu.com-20130617222454-biw3dmaqdd9qpbh7
Tags: 3.8.3.1-1
[ Jeremy Bicha ]
* New upstream release
* debian/control.in:
  - Add missing dependency on gir1.2-gnomedesktop-3.0
  - Bump minimum GTK for newer libgd
  - Build-depend on gtk-doc-tools and yelp-tools
  - Build-depend on inkscape and poppler-utils to generate
    getting-started PDF
* debian/rules: --enable-getting-started

Show diffs side-by-side

added added

removed removed

Lines of Context:
272
272
 
273
273
    _init: function(dropdown) {
274
274
        this._dropdown = dropdown;
 
275
        this._selectAll = Application.application.lookup_action('select-all');
275
276
 
276
277
        this.parent();
277
278
 
298
299
            Lang.bind(this, this._onTagClicked));
299
300
 
300
301
        // connect to search string changes in the controller
301
 
        let searchChangedId = Application.searchController.connect('search-string-changed', Lang.bind(this,
302
 
            function(controller, string) {
303
 
                this._searchEntry.set_text(string);
304
 
            }));
 
302
        this._searchChangedId = Application.searchController.connect('search-string-changed',
 
303
            Lang.bind(this, this._onSearchStringChanged));
305
304
 
306
305
        this._searchEntry.connect('destroy', Lang.bind(this,
307
306
            function() {
308
307
                this._dropdown.widget.reveal_child = false;
309
 
                Application.searchController.disconnect(searchChangedId);
 
308
                Application.searchController.disconnect(this._searchChangedId);
310
309
            }));
311
310
 
312
311
        // create the dropdown button
335
334
 
336
335
    entryChanged: function() {
337
336
        let currentText = this._searchEntry.get_text().toLowerCase();
 
337
 
 
338
        Application.searchController.disconnect(this._searchChangedId);
338
339
        Application.searchController.setString(currentText);
 
340
 
 
341
        // connect to search string changes in the controller
 
342
        this._searchChangedId = Application.searchController.connect('search-string-changed',
 
343
            Lang.bind(this, this._onSearchStringChanged));
 
344
    },
 
345
 
 
346
    _onSearchStringChanged: function(controller, string) {
 
347
        this._searchEntry.set_text(string);
339
348
    },
340
349
 
341
350
    _onActiveCollectionChanged: function() {
407
416
        this.parent();
408
417
    },
409
418
 
 
419
    show: function() {
 
420
        this._selectAll.enabled = false;
 
421
        this.parent();
 
422
    },
 
423
 
410
424
    hide: function() {
411
425
        this._dropdownButton.set_active(false);
 
426
        this._selectAll.enabled = true;
412
427
 
413
428
        Application.searchTypeManager.setActiveItemById('all');
414
429
        Application.searchMatchManager.setActiveItemById('all');