How to use the ko/ui/button.create function in ko

To help you get started, we’ve selected a few ko examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Komodo / KomodoEdit / src / chrome / komodo / content / sdk / share / sources / trackchanges.js View on Github external
function addButton()
    {
        $("#trackChangesShareButton").remove();
        
        // Update button in track changes
        var $trackchanges = $("#changeTracker_hbox");
        
        // Create the button if it doens't exist
        var shareButton = require("ko/ui/button").create('Share',
            {
                attributes:
                {
                    type: "menu",
                    id: "trackChangesShareButton",
                    tooltiptext:"Share Changeset .."
                }
            });
        
        //Create the new modules menuitem for this menu
        for (let id in koShare.modules)
        {
            let module = koShare.modules[id];
            let menuitem = require("ko/ui/menuitem").create({
                attributes: {
                    label:  module.label
github Komodo / KomodoEdit / src / chrome / komodo / content / sdk / share / slack / dialog.js View on Github external
function createPostAndOpenBtn()
    {
       return require("ko/ui/button").create({attributes:{label:"Share & Open Browser",disabled:true}});
    }
github Komodo / KomodoEdit / src / chrome / komodo / content / sdk / modal.js View on Github external
wrapper.addRow(
            errorLabel,
            { attributes: { align: "center", pack: "center", class: "ui-error" } }
        );
        
        var buttonRow = wrapper.addRow({ attributes: { align: "center", pack: "center" } });
        buttonRow.addClass("buttons-ui");
        
        if (opts.onComplete)
        {
            var okButton = require("ko/ui/button").create(opts.okLabel);
            okButton.onCommand(onFormComplete.bind(this, opts));
            buttonRow.add(okButton);
        }
        
        var cancelButton = require("ko/ui/button").create(opts.cancelLabel);
        cancelButton.onCommand(function()
        {
            parent.close();
            
            if (opts.onComplete)
                opts.onComplete();
        });
        buttonRow.add(cancelButton);
        
        if (opts.onReady)
            opts.onReady(parent, mapping);

        parent.sizeToContent();
    };
github Komodo / KomodoEdit / src / chrome / komodo / content / sdk / share / slack / dialog.js View on Github external
function createPostBtn()
    {
       return require("ko/ui/button").create({attributes:{label:"Share on Slack",disabled:true}});
    }
github Komodo / KomodoEdit / src / chrome / komodo / content / sdk / ui / filepath.js View on Github external
this.init = function()
        {
            this.defaultInit.apply(this, arguments);
            this.textbox = require("ko/ui/textbox").create({ attributes: this.attributes });
            
            var button = require("ko/ui/button").create("...");
            button.onCommand(() =>
            {
                var ko = require("ko/windows").getMain().ko;
                
                var type = this.attributes.filetype || this.options.filetype || "file";
                var value = this.textbox.value();
                
                var filter = this.attributes.filter || null;
                var filters = this.attributes.filters || null;

                switch (type)
                {
                    default:
                    case "file":
                        this.textbox.value(ko.filepicker.browseForFile(value, null, null, filter, filters));
                        break;
github Komodo / KomodoEdit / src / chrome / komodo / content / sdk / modal.js View on Github external
elem.value(field.value);
        }
        
        var errorLabel = require("ko/ui/label").create({ attributes: { class: "fullwidth state-error" } });
        errorLabel.hide();
        wrapper.addRow(
            errorLabel,
            { attributes: { align: "center", pack: "center", class: "ui-error" } }
        );
        
        var buttonRow = wrapper.addRow({ attributes: { align: "center", pack: "center" } });
        buttonRow.addClass("buttons-ui");
        
        if (opts.onComplete)
        {
            var okButton = require("ko/ui/button").create(opts.okLabel);
            okButton.onCommand(onFormComplete.bind(this, opts));
            buttonRow.add(okButton);
        }
        
        var cancelButton = require("ko/ui/button").create(opts.cancelLabel);
        cancelButton.onCommand(function()
        {
            parent.close();
            
            if (opts.onComplete)
                opts.onComplete();
        });
        buttonRow.add(cancelButton);
        
        if (opts.onReady)
            opts.onReady(parent, mapping);
github Komodo / KomodoEdit / src / chrome / komodo / content / sdk / share / slack / dialog.js View on Github external
function createCloseBtn()
    {
        return require("ko/ui/button").create({attributes:{label:"Cancel"}});
    }